17#ifndef LLVM_CLANG_CODEGEN_CONSTANTINITFUTURE_H
18#define LLVM_CLANG_CODEGEN_CONSTANTINITFUTURE_H
20#include "llvm/ADT/PointerUnion.h"
21#include "llvm/IR/Constant.h"
47class ConstantInitFuture {
48 using PairTy = llvm::PointerUnion<ConstantInitBuilderBase*, llvm::Constant*>;
60 assert(initializer &&
"creating null future");
64 explicit operator bool()
const {
return bool(Data); }
78 ConstantInitFuture result;
79 result.Data = PairTy::getFromOpaqueValue(value);
A convenience builder class for complex constant initializers, especially for anonymous global struct...
A "future" for a completed constant initializer, which can be passed around independently of any sub-...
llvm::Type * getType() const
Return the type of the initializer.
static constexpr int NumLowBitsAvailable
static ConstantInitFuture getFromOpaqueValue(void *value)
void abandon()
Abandon this initializer.
ConstantInitFuture(llvm::Constant *initializer)
A future can be explicitly created from a fixed initializer.
friend class ConstantInitBuilderBase
void installInGlobal(llvm::GlobalVariable *global)
Install the initializer into a global variable.
void * getOpaqueValue() const
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
static T getFromVoidPointer(void *p)
static void * getAsVoidPointer(T p)
static constexpr int NumLowBitsAvailable
::clang::CodeGen::ConstantInitBuilderBase * T
::clang::CodeGen::ConstantInitFuture T
static constexpr int NumLowBitsAvailable
static void * getAsVoidPointer(T future)
static T getFromVoidPointer(void *p)