15 #ifndef LLVM_CLANG_LIB_CODEGEN_CONSTANTEMITTER_H 16 #define LLVM_CLANG_LIB_CODEGEN_CONSTANTEMITTER_H 30 bool Abstract =
false;
33 bool InitializedNonAbstract =
false;
36 bool Finalized =
false;
42 bool InConstantContext =
false;
53 : CGM(CGM), CGF(CGF) {}
59 : CGM(CGF.CGM), CGF(&CGF) {}
79 void finalize(llvm::GlobalVariable *global);
152 llvm::GlobalValue *placeholder);
155 void initializeNonAbstract(
LangAS destAS) {
156 assert(!InitializedNonAbstract);
157 InitializedNonAbstract =
true;
158 DestAddressSpace = destAS;
160 llvm::Constant *markIfFailed(llvm::Constant *init) {
166 struct AbstractState {
168 size_t OldPlaceholdersSize;
170 AbstractState pushAbstract() {
171 AbstractState saved = { Abstract, PlaceholderAddresses.size() };
175 llvm::Constant *validateAndPopAbstract(llvm::Constant *C, AbstractState save);
A (possibly-)qualified type.
llvm::Constant * emitForInitializer(const APValue &value, LangAS destAddrSpace, QualType destType)
llvm::Constant * tryEmitForInitializer(const VarDecl &D)
Try to emit the initiaizer of the given declaration as an abstract constant.
llvm::Constant * emitForMemory(llvm::Constant *C, QualType T)
llvm::Constant * tryEmitPrivateForVarInit(const VarDecl &D)
Represents a variable declaration or definition.
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
CodeGenFunction - This class organizes the per-function state that is used while generating LLVM code...
llvm::Constant * tryEmitAbstractForInitializer(const VarDecl &D)
Try to emit the initializer of the given declaration as an abstract constant.
ConstantEmitter & operator=(const ConstantEmitter &other)=delete
ConstantEmitter(CodeGenModule &CGM, CodeGenFunction *CGF=nullptr)
llvm::Constant * tryEmitPrivate(const Expr *E, QualType T)
llvm::GlobalValue * getCurrentAddrPrivate()
Get the address of the current location.
ConstantEmitter(CodeGenFunction &CGF)
Initialize this emission in the context of the given function.
This represents one expression.
Encodes a location in the source.
llvm::Constant * emitAbstract(const Expr *E, QualType T)
Emit the result of the given expression as an abstract constant, asserting that it succeeded...
void registerCurrentAddrPrivate(llvm::Constant *signal, llvm::GlobalValue *placeholder)
Register a 'signal' value with the emitter to inform it where to resolve a placeholder.
llvm::Constant * emitNullForMemory(QualType T)
This class organizes the cross-function state that is used while generating LLVM code.
Dataflow Directional Tag Classes.
llvm::Constant * tryEmitPrivateForMemory(const Expr *E, QualType T)
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
void finalize(llvm::GlobalVariable *global)
llvm::Constant * tryEmitAbstract(const Expr *E, QualType T)
Try to emit the result of the given expression as an abstract constant.
bool isAbstract() const
Is the current emission context abstract?
llvm::Constant * tryEmitAbstractForMemory(const Expr *E, QualType T)