LLVM 22.0.0git
Public Member Functions | List of all members
llvm::OptDisable Class Reference

This class implements a mechanism to disable passes and individual optimizations at compile time based on a command line option (-opt-disable) in order to study how single transformations, or combinations thereof, affect the IR. More...

#include "llvm/IR/OptBisect.h"

Inheritance diagram for llvm::OptDisable:
[legend]

Public Member Functions

bool shouldRunPass (StringRef PassName, StringRef IRDescription) const override
 Checks the pass name to determine if the specified pass should run.
 
void setDisabled (StringRef Pass)
 Parses the command line argument to extract the names of the passes to be disabled.
 
bool isEnabled () const override
 isEnabled() should return true before calling shouldRunPass().
 
- Public Member Functions inherited from llvm::OptPassGate
virtual ~OptPassGate ()=default
 
virtual bool shouldRunPass (StringRef PassName, StringRef IRDescription) const
 IRDescription is a textual description of the IR unit the pass is running over.
 
virtual bool isEnabled () const
 isEnabled() should return true before calling shouldRunPass().
 

Detailed Description

This class implements a mechanism to disable passes and individual optimizations at compile time based on a command line option (-opt-disable) in order to study how single transformations, or combinations thereof, affect the IR.

Definition at line 90 of file OptBisect.h.

Member Function Documentation

◆ isEnabled()

bool llvm::OptDisable::isEnabled ( ) const
inlineoverridevirtual

isEnabled() should return true before calling shouldRunPass().

Reimplemented from llvm::OptPassGate.

Definition at line 110 of file OptBisect.h.

Referenced by shouldRunPass().

◆ setDisabled()

void OptDisable::setDisabled ( StringRef  Pass)

Parses the command line argument to extract the names of the passes to be disabled.

Multiple pass names can be provided with comma separation.

Definition at line 82 of file OptBisect.cpp.

References llvm::StringSet< AllocatorTy >::insert().

◆ shouldRunPass()

bool OptDisable::shouldRunPass ( StringRef  PassName,
StringRef  IRDescription 
) const
overridevirtual

Checks the pass name to determine if the specified pass should run.

It returns true if the pass should run, i.e. if its name is was not provided via command line. If -opt-disable-enable-verbosity is given, the method prints the name of the pass, and whether or not the pass will be executed.

Most passes should not call this routine directly. Instead, it is called through helper routines provided by the base classes of the pass. For instance, function passes should call FunctionPass::skipFunction().

Reimplemented from llvm::OptPassGate.

Definition at line 84 of file OptBisect.cpp.

References assert(), llvm::StringSet< AllocatorTy >::contains(), isEnabled(), OptDisableVerbose, PassName, and printDisablePassMessage().


The documentation for this class was generated from the following files: