|
LLVM 24.0.0git
|
This class evaluates LLVM IR, producing the Constant representing each SSA instruction. More...
#include "llvm/Transforms/Utils/Evaluator.h"
Public Member Functions | |
| Evaluator (const DataLayout &DL, const function_ref< TargetLibraryInfo &(Function &)> GetTLI) | |
| ~Evaluator () | |
| LLVM_ABI bool | EvaluateFunction (Function *F, Constant *&RetVal, const SmallVectorImpl< Constant * > &ActualArgs) |
| Evaluate a call to function F, returning true if successful, false if we can't evaluate it. | |
| DenseMap< GlobalVariable *, Constant * > | getMutatedInitializers () const |
| const SmallPtrSetImpl< GlobalVariable * > & | getInvariants () const |
This class evaluates LLVM IR, producing the Constant representing each SSA instruction.
Changes to global variables are stored in a mapping that can be iterated over after the evaluation is complete. Once an evaluation call fails, the evaluation object should not be reused.
Definition at line 37 of file Evaluator.h.
|
inline |
Definition at line 82 of file Evaluator.h.
|
inline |
Definition at line 88 of file Evaluator.h.
References llvm::Constant::getNullValue().
| bool Evaluator::EvaluateFunction | ( | Function * | F, |
| Constant *& | RetVal, | ||
| const SmallVectorImpl< Constant * > & | ActualArgs ) |
Evaluate a call to function F, returning true if successful, false if we can't evaluate it.
ActualArgs contains the formal arguments for the function.
Definition at line 633 of file Evaluator.cpp.
References assert(), llvm::BasicBlock::begin(), llvm::cast(), llvm::dbgs(), llvm::dyn_cast(), llvm::enumerate(), F, llvm::PHINode::getIncomingValueForBlock(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::ReturnInst::getReturnValue(), llvm::BasicBlock::getTerminator(), llvm::Value::getType(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::is_contained(), llvm::Type::isVoidTy(), LLVM_DEBUG, llvm::SmallVectorTemplateCommon< T, typename >::size(), and TLI.
Referenced by EvaluateStaticConstructor().
|
inline |
Definition at line 110 of file Evaluator.h.
Referenced by EvaluateStaticConstructor().
|
inline |
Definition at line 103 of file Evaluator.h.
Referenced by EvaluateStaticConstructor().