LLVM  15.0.0git
Classes | Public Member Functions | List of all members
llvm::Evaluator Class Reference

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. More...
 
DenseMap< GlobalVariable *, Constant * > getMutatedInitializers () const
 
const SmallPtrSetImpl< GlobalVariable * > & getInvariants () const
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Evaluator()

llvm::Evaluator::Evaluator ( const DataLayout DL,
const TargetLibraryInfo TLI 
)
inline

Definition at line 82 of file Evaluator.h.

References DL.

◆ ~Evaluator()

llvm::Evaluator::~Evaluator ( )
inline

Definition at line 87 of file Evaluator.h.

References llvm::Constant::getNullValue().

Member Function Documentation

◆ EvaluateFunction()

bool Evaluator::EvaluateFunction ( Function F,
Constant *&  RetVal,
const SmallVectorImpl< Constant * > &  ActualArgs 
)

◆ getInvariants()

const SmallPtrSetImpl<GlobalVariable *>& llvm::Evaluator::getInvariants ( ) const
inline

Definition at line 109 of file Evaluator.h.

Referenced by EvaluateStaticConstructor().

◆ getMutatedInitializers()

DenseMap<GlobalVariable *, Constant *> llvm::Evaluator::getMutatedInitializers ( ) const
inline

Definition at line 102 of file Evaluator.h.

Referenced by EvaluateStaticConstructor().


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