LLVM 20.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 TargetLibraryInfo *TLI) | |
~Evaluator () | |
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.
References DL.
|
inline |
Definition at line 87 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 629 of file Evaluator.cpp.
References assert(), llvm::BasicBlock::begin(), llvm::dbgs(), 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, and llvm::SmallVectorBase< Size_T >::size().
Referenced by EvaluateStaticConstructor().
|
inline |
Definition at line 109 of file Evaluator.h.
Referenced by EvaluateStaticConstructor().
|
inline |
Definition at line 102 of file Evaluator.h.
Referenced by EvaluateStaticConstructor().