LLVM 22.0.0git
Evaluator.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "evaluator"

Functions

static bool isSimpleEnoughValueToCommit (Constant *C, SmallPtrSetImpl< Constant * > &SimpleConstants, const DataLayout &DL)
static bool isSimpleEnoughValueToCommitHelper (Constant *C, SmallPtrSetImpl< Constant * > &SimpleConstants, const DataLayout &DL)
 Return true if the specified constant can be handled by the code generator.
static FunctiongetFunction (Constant *C)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "evaluator"

Definition at line 39 of file Evaluator.cpp.

Function Documentation

◆ getFunction()

Function * getFunction ( Constant * C)
static

Definition at line 237 of file Evaluator.cpp.

References llvm::CallingConv::C, and llvm::dyn_cast().

◆ isSimpleEnoughValueToCommit()

bool isSimpleEnoughValueToCommit ( Constant * C,
SmallPtrSetImpl< Constant * > & SimpleConstants,
const DataLayout & DL )
inlinestatic

◆ isSimpleEnoughValueToCommitHelper()

bool isSimpleEnoughValueToCommitHelper ( Constant * C,
SmallPtrSetImpl< Constant * > & SimpleConstants,
const DataLayout & DL )
static

Return true if the specified constant can be handled by the code generator.

We don't want to generate something like: void *X = &X/42; because the code generator doesn't have a relocation that can handle that.

This function should be called if C was not found (but just got inserted) in SimpleConstants to avoid having to rescan the same constants all the time.

Definition at line 57 of file Evaluator.cpp.

References llvm::CallingConv::C, llvm::cast(), DL, llvm::dyn_cast(), llvm::isa(), and isSimpleEnoughValueToCommit().

Referenced by isSimpleEnoughValueToCommit().