15 #ifndef LLVM_IR_MDBUILDER_H
16 #define LLVM_IR_MDBUILDER_H
21 #include "llvm/Support/DataTypes.h"
27 template <
typename T>
class ArrayRef;
30 class ConstantAsMetadata;
146 Offset(Offset), Size(Size), TBAA(TBAA) {}
157 ArrayRef<std::pair<MDNode *, uint64_t>> Fields);
167 uint64_t
Offset,
bool IsConstant =
false);
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
static bool isConstant(const MachineInstr &MI)
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 * createFunctionEntryCount(uint64_t Count, const DenseSet< GlobalValue::GUID > *Imports)
Return metadata containing the entry Count for a function, and the GUIDs stored in Imports that need ...
Implements a dense probed hash-table based set.
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 * 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...
BaseType
A given derived pointer can have multiple base pointers through phi/selects.
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.