15 #ifndef LLVM_IR_MDBUILDER_H
16 #define LLVM_IR_MDBUILDER_H
19 #include "llvm/Support/DataTypes.h"
25 template <
typename T>
class ArrayRef;
28 class ConstantAsMetadata;
134 bool isConstant =
false);
141 Offset(Offset), Size(Size), TBAA(TBAA) {}
152 ArrayRef<std::pair<MDNode *, uint64_t>> Fields);
162 uint64_t
Offset,
bool IsConstant =
false);
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
MDNode * createAnonymousAARoot(StringRef Name=StringRef(), MDNode *Extra=nullptr)
Return metadata appropriate for a AA root node (scope or TBAA).
MDNode * createUnpredictable()
Return metadata specifying that a branch or switch is unpredictable.
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
MDNode * createAnonymousTBAARoot()
Return metadata appropriate for a TBAA root node.
MDNode * createAnonymousAliasScope(MDNode *Domain, StringRef Name=StringRef())
Return metadata appropriate for an alias scope root node.
MDBuilder(LLVMContext &context)
TBAAStructField(uint64_t Offset, uint64_t Size, MDNode *TBAA)
MDNode * createFPMath(float Accuracy)
Return metadata with the given settings.
This is an important class for using LLVM in a threaded context.
This is an important base class in LLVM.
MDNode * createAliasScopeDomain(StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
MDNode * createFunctionEntryCount(uint64_t Count)
Return metadata containing the entry count for a function.
MDNode * createTBAAStructNode(ArrayRef< TBAAStructField > Fields)
Return metadata for a tbaa.struct node with the given struct field descriptions.
MDNode * createBranchWeights(uint32_t TrueWeight, uint32_t FalseWeight)
Return metadata containing two branch weights.
MDNode * createAnonymousAliasScopeDomain(StringRef Name=StringRef())
Return metadata appropriate for an alias scope domain node.
MDNode * createTBAAScalarTypeNode(StringRef Name, MDNode *Parent, uint64_t Offset=0)
Return metadata for a TBAA scalar type node with the given name, an offset and a parent in the TBAA t...
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
Class for arbitrary precision integers.
MDNode * createTBAAStructTypeNode(StringRef Name, ArrayRef< std::pair< MDNode *, uint64_t >> Fields)
Return metadata for a TBAA struct node in the type DAG with the given name, a list of pairs (offset...
MDString * createString(StringRef Str)
Return the given string as metadata.
MDNode * createAliasScope(StringRef Name, MDNode *Domain)
Return metadata appropriate for an alias scope node with the given name.
MDNode * createTBAAStructTagNode(MDNode *BaseType, MDNode *AccessType, uint64_t Offset, bool IsConstant=false)
Return metadata for a TBAA tag node with the given base type, access type and offset relative to the ...
MDNode * createTBAANode(StringRef Name, MDNode *Parent, bool isConstant=false)
Return metadata for a non-root TBAA node with the given name, parent in the TBAA tree, and value for 'pointsToConstantMemory'.
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
StringRef - Represent a constant reference to a string, i.e.
MDNode * createTBAARoot(StringRef Name)
Return metadata appropriate for a TBAA root node with the given name.