14 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENTBAA_H 15 #define LLVM_CLANG_LIB_CODEGEN_CODEGENTBAA_H 19 #include "llvm/ADT/DenseMap.h" 20 #include "llvm/IR/MDBuilder.h" 21 #include "llvm/IR/Metadata.h" 44 llvm::MDNode *AccessType, uint64_t
Offset, uint64_t Size)
45 : Kind(Kind), BaseType(BaseType), AccessType(AccessType),
46 Offset(Offset), Size(Size)
50 uint64_t
Offset, uint64_t Size)
88 return !(*
this == Other);
91 explicit operator bool()
const {
125 llvm::MDBuilder MDHelper;
129 llvm::DenseMap<const Type *, llvm::MDNode *> MetadataCache;
131 llvm::DenseMap<const Type *, llvm::MDNode *> BaseTypeMetadataCache;
133 llvm::DenseMap<TBAAAccessInfo, llvm::MDNode *> AccessTagMetadataCache;
137 llvm::DenseMap<const Type *, llvm::MDNode *> StructMetadataCache;
148 llvm::MDNode *getChar();
152 bool CollectFields(uint64_t BaseOffset,
159 llvm::MDNode *createScalarTypeNode(StringRef Name, llvm::MDNode *
Parent,
164 llvm::MDNode *getTypeInfoHelper(
const Type *Ty);
168 llvm::MDNode *getBaseTypeInfoHelper(
const Type *Ty);
177 llvm::MDNode *getTypeInfo(
QualType QTy);
189 llvm::MDNode *getTBAAStructInfo(
QualType QTy);
193 llvm::MDNode *getBaseTypeInfo(
QualType QTy);
223 static_cast<clang::CodeGen::TBAAAccessKind>(UnsignedKey),
233 static_cast<clang::CodeGen::TBAAAccessKind>(UnsignedKey),
241 auto KindValue =
static_cast<unsigned>(Val.
Kind);
A (possibly-)qualified type.
TBAAAccessInfo(llvm::MDNode *AccessType, uint64_t Size)
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
C Language Family Type Representation.
llvm::MDNode * AccessType
AccessType - The final access type.
TBAAAccessKind Kind
Kind - The kind of the access descriptor.
static bool isEqual(const clang::CodeGen::TBAAAccessInfo &LHS, const clang::CodeGen::TBAAAccessInfo &RHS)
The base class of the type hierarchy.
TBAAAccessInfo(TBAAAccessKind Kind, llvm::MDNode *BaseType, llvm::MDNode *AccessType, uint64_t Offset, uint64_t Size)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Describes a module or submodule.
bool isIncomplete() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
static TBAAAccessInfo getIncompleteInfo()
static DeltaTreeNode * getRoot(void *Root)
static clang::CodeGen::TBAAAccessInfo getTombstoneKey()
Exposes information about the current target.
The l-value was considered opaque, so the alignment was determined from a type.
bool operator==(const TBAAAccessInfo &Other) const
llvm::MDNode * BaseType
BaseType - The base/leading access type.
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
uint64_t Size
Size - The size of access, in bytes.
bool operator!=(const TBAAAccessInfo &Other) const
Optional< types::ID > Type
Dataflow Directional Tag Classes.
static clang::CodeGen::TBAAAccessInfo getEmptyKey()
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
CodeGenTBAA - This class organizes the cross-module state that is used while lowering AST types to LL...
static unsigned getHashValue(const clang::CodeGen::TBAAAccessInfo &Val)
uint64_t Offset
Offset - The byte offset of the final access within the base one.
static TBAAAccessInfo getMayAliasInfo()
TBAAAccessInfo(llvm::MDNode *BaseType, llvm::MDNode *AccessType, uint64_t Offset, uint64_t Size)