18 #ifndef LLVM_CLANG_CODEGEN_CONSTANTINITFUTURE_H
19 #define LLVM_CLANG_CODEGEN_CONSTANTINITFUTURE_H
21 #include "llvm/ADT/PointerUnion.h"
22 #include "llvm/IR/Constant.h"
29 class ConstantInitBuilderBase;
40 enum { NumLowBitsAvailable = 2 };
50 using PairTy = llvm::PointerUnion<ConstantInitBuilderBase*, llvm::Constant*>;
62 assert(initializer &&
"creating null future");
66 explicit operator bool()
const {
return bool(Data); }
81 result.Data = PairTy::getFromOpaqueValue(value);
104 return T::getFromOpaqueValue(p);
106 enum { NumLowBitsAvailable = T::NumLowBitsAvailable };
static void * getAsVoidPointer(T future)
llvm::Type * getType() const
Return the type of the initializer.
void abandon()
Abandon this initializer.
static void * getAsVoidPointer(T p)
static T getFromVoidPointer(void *p)
The l-value was considered opaque, so the alignment was determined from a type.
ConstantInitFuture(llvm::Constant *initializer)
A future can be explicitly created from a fixed initializer.
A "future" for a completed constant initializer, which can be passed around independently of any sub-...
static ConstantInitFuture getFromOpaqueValue(void *value)
void * getOpaqueValue() const
static T getFromVoidPointer(void *p)
void installInGlobal(llvm::GlobalVariable *global)
Install the initializer into a global variable.