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"
28class ConstantInitBuilderBase;
38 static constexpr int NumLowBitsAvailable = 2;
48 using PairTy = llvm::PointerUnion<ConstantInitBuilderBase*, llvm::Constant*>;
60 assert(initializer &&
"creating null future");
79 result.Data = PairTy::getFromOpaqueValue(value);
99 return T::getFromOpaqueValue(p);
101 static constexpr int NumLowBitsAvailable = T::NumLowBitsAvailable;
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.
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 void * getAsVoidPointer(T future)
static T getFromVoidPointer(void *p)