15 #ifndef LLVM_CLANG_LIB_CODEGEN_ADDRESS_H 16 #define LLVM_CLANG_LIB_CODEGEN_ADDRESS_H 18 #include "llvm/IR/Constants.h" 30 : Pointer(pointer), Alignment(alignment) {
31 assert((!alignment.
isZero() || pointer ==
nullptr) &&
32 "creating valid address with invalid alignment");
36 bool isValid()
const {
return Pointer !=
nullptr; }
45 return llvm::cast<llvm::PointerType>(
getPointer()->getType());
53 return getType()->getElementType();
58 return getType()->getAddressSpace();
78 :
Address(pointer, alignment) {}
98 return llvm::isa<llvm::Constant>(addr.
getPointer());
110 return U::castImpl(addr);
113 return U::isaImpl(addr);
ConstantAddress(llvm::Constant *pointer, CharUnits alignment)
bool isZero() const
isZero - Test whether the quantity equals zero.
llvm::Value * getPointer() const
unsigned getAddressSpace() const
Return the address space that this address resides in.
static bool isaImpl(Address addr)
CharUnits - This is an opaque type for sizes expressed in character units.
CharUnits getAlignment() const
Return the alignment of this pointer.
ConstantAddress getElementBitCast(llvm::Type *ty) const
static ConstantAddress castImpl(Address addr)
llvm::PointerType * getType() const
Return the type of the pointer value.
bool isa(CodeGen::Address addr)
Address(llvm::Value *pointer, CharUnits alignment)
The l-value was considered opaque, so the alignment was determined from a type.
ConstantAddress getBitCast(llvm::Type *ty) const
Dataflow Directional Tag Classes.
llvm::Constant * getPointer() const
U cast(CodeGen::Address addr)
llvm::Type * getElementType() const
Return the type of the values stored in this address.
llvm::StringRef getName() const
Return the IR name of the pointer value.
A specialization of Address that requires the address to be an LLVM Constant.
static ConstantAddress invalid()