15 #ifndef LLVM_CLANG_LIB_CODEGEN_CODEGENTBAA_H
16 #define LLVM_CLANG_LIB_CODEGEN_CODEGENTBAA_H
20 #include "llvm/ADT/DenseMap.h"
21 #include "llvm/IR/MDBuilder.h"
22 #include "llvm/IR/Metadata.h"
52 llvm::MDBuilder MDHelper;
56 llvm::DenseMap<const Type *, llvm::MDNode *> MetadataCache;
58 llvm::DenseMap<const Type *, llvm::MDNode *> StructTypeMetadataCache;
60 llvm::DenseMap<TBAAPathTag, llvm::MDNode *> StructTagMetadataCache;
62 llvm::DenseMap<const llvm::MDNode *, llvm::MDNode *> ScalarTagMetadataCache;
66 llvm::DenseMap<const Type *, llvm::MDNode *> StructMetadataCache;
73 llvm::MDNode *getRoot();
77 llvm::MDNode *getChar();
81 bool CollectFields(uint64_t BaseOffset,
89 llvm::MDNode *createTBAAScalarType(StringRef
Name, llvm::MDNode *Parent);
115 llvm::MDNode *AccessNode, uint64_t
Offset);
A (possibly-)qualified type.
C Language Family Type Representation.
The base class of the type hierarchy.
CodeGenTBAA(ASTContext &Ctx, llvm::LLVMContext &VMContext, const CodeGenOptions &CGO, const LangOptions &Features, MangleContext &MContext)
const llvm::MDNode * AccessN
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
static unsigned getHashValue(const clang::CodeGen::TBAAPathTag &Val)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::MDNode * getTBAAInfoForVTablePtr()
getTBAAInfoForVTablePtr - Get the TBAA MDNode to be used for a dereference of a vtable pointer...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
llvm::MDNode * getTBAAStructTypeInfo(QualType QType)
Get the MDNode in the type DAG for given struct type QType.
llvm::MDNode * getTBAAScalarTagInfo(llvm::MDNode *AccessNode)
Get the scalar tag MDNode for a given scalar type.
The l-value was considered opaque, so the alignment was determined from a type.
MangleContext - Context for tracking state which persists across multiple calls to the C++ name mangl...
TBAAPathTag(const Type *B, const llvm::MDNode *A, uint64_t O)
static clang::CodeGen::TBAAPathTag getEmptyKey()
llvm::MDNode * getTBAAStructInfo(QualType QTy)
getTBAAStructInfo - Get the TBAAStruct MDNode to be used for a memcpy of the given type...
llvm::MDNode * getTBAAStructTagInfo(QualType BaseQType, llvm::MDNode *AccessNode, uint64_t Offset)
Get the tag MDNode for a given base type, the actual scalar access MDNode and offset into the base ty...
llvm::MDNode * getTBAAInfo(QualType QTy)
getTBAAInfo - Get the TBAA MDNode to be used for a dereference of the given type. ...
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
static clang::CodeGen::TBAAPathTag getTombstoneKey()
CodeGenTBAA - This class organizes the cross-module state that is used while lowering AST types to LL...
static bool isEqual(const clang::CodeGen::TBAAPathTag &LHS, const clang::CodeGen::TBAAPathTag &RHS)