LLVM API Documentation
#include <MDBuilder.h>
Classes | |
struct | TBAAStructField |
Public Member Functions | |
MDBuilder (LLVMContext &context) | |
MDString * | createString (StringRef Str) |
Return the given string as metadata. | |
MDNode * | createFPMath (float Accuracy) |
Return metadata with the given settings. The special value 0.0 for the Accuracy parameter indicates the default (maximal precision) setting. | |
MDNode * | createBranchWeights (uint32_t TrueWeight, uint32_t FalseWeight) |
Return metadata containing two branch weights. | |
MDNode * | createBranchWeights (ArrayRef< uint32_t > Weights) |
Return metadata containing a number of branch weights. | |
MDNode * | createRange (const APInt &Lo, const APInt &Hi) |
Return metadata describing the range [Lo, Hi). | |
MDNode * | createAnonymousTBAARoot () |
Return metadata appropriate for a TBAA root node. Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else. | |
MDNode * | createAnonymousAliasScopeDomain (StringRef Name=StringRef()) |
Return metadata appropriate for an alias scope domain node. Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else. | |
MDNode * | createAnonymousAliasScope (MDNode *Domain, StringRef Name=StringRef()) |
Return metadata appropriate for an alias scope root node. Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else. | |
MDNode * | createTBAARoot (StringRef Name) |
Return metadata appropriate for a TBAA root node with the given name. This may be identified (uniqued) with other roots with the same name. | |
MDNode * | createAliasScopeDomain (StringRef Name) |
Return metadata appropriate for an alias scope domain node with the given name. This may be identified (uniqued) with other roots with the same name. | |
MDNode * | createAliasScope (StringRef Name, MDNode *Domain) |
Return metadata appropriate for an alias scope node with the given name. This may be identified (uniqued) with other scopes with the same name and domain. | |
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 * | createTBAAStructNode (ArrayRef< TBAAStructField > Fields) |
Return metadata for a tbaa.struct node with the given struct field descriptions. | |
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, field type in the type DAG). | |
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 type DAG. | |
MDNode * | createTBAAStructTagNode (MDNode *BaseType, MDNode *AccessType, uint64_t Offset) |
Return metadata for a TBAA tag node with the given base type, access type and offset relative to the base type. | |
Protected Member Functions | |
MDNode * | createAnonymousAARoot (StringRef Name=StringRef(), MDNode *Extra=nullptr) |
Return metadata appropriate for a AA root node (scope or TBAA). Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else. |
Definition at line 30 of file MDBuilder.h.
llvm::MDBuilder::MDBuilder | ( | LLVMContext & | context | ) | [inline] |
Definition at line 34 of file MDBuilder.h.
MDNode * MDBuilder::createAliasScope | ( | StringRef | Name, |
MDNode * | Domain | ||
) |
Return metadata appropriate for an alias scope node with the given name. This may be identified (uniqued) with other scopes with the same name and domain.
Definition at line 107 of file MDBuilder.cpp.
References createString(), and llvm::MDNode::get().
MDNode * MDBuilder::createAliasScopeDomain | ( | StringRef | Name | ) |
Return metadata appropriate for an alias scope domain node with the given name. This may be identified (uniqued) with other roots with the same name.
Definition at line 103 of file MDBuilder.cpp.
References createString(), and llvm::MDNode::get().
MDNode * MDBuilder::createAnonymousAARoot | ( | StringRef | Name = StringRef() , |
MDNode * | Extra = nullptr |
||
) | [protected] |
Return metadata appropriate for a AA root node (scope or TBAA). Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else.
Definition at line 63 of file MDBuilder.cpp.
References createString(), llvm::MDNode::deleteTemporary(), llvm::NVPTXISD::Dummy, llvm::StringRef::empty(), llvm::MDNode::get(), llvm::MDNode::getTemporary(), llvm::None, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::MDNode::replaceOperandWith().
Referenced by createAnonymousAliasScope(), createAnonymousAliasScopeDomain(), and createAnonymousTBAARoot().
MDNode* llvm::MDBuilder::createAnonymousAliasScope | ( | MDNode * | Domain, |
StringRef | Name = StringRef() |
||
) | [inline] |
Return metadata appropriate for an alias scope root node. Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else.
Definition at line 94 of file MDBuilder.h.
References createAnonymousAARoot(), and Name.
MDNode* llvm::MDBuilder::createAnonymousAliasScopeDomain | ( | StringRef | Name = StringRef() | ) | [inline] |
Return metadata appropriate for an alias scope domain node. Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else.
Definition at line 87 of file MDBuilder.h.
References createAnonymousAARoot(), and Name.
MDNode* llvm::MDBuilder::createAnonymousTBAARoot | ( | ) | [inline] |
Return metadata appropriate for a TBAA root node. Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else.
Definition at line 80 of file MDBuilder.h.
References createAnonymousAARoot().
MDNode * MDBuilder::createBranchWeights | ( | uint32_t | TrueWeight, |
uint32_t | FalseWeight | ||
) |
Return metadata containing two branch weights.
Definition at line 32 of file MDBuilder.cpp.
MDNode * MDBuilder::createBranchWeights | ( | ArrayRef< uint32_t > | Weights | ) |
Return metadata containing a number of branch weights.
Definition at line 38 of file MDBuilder.cpp.
References createString(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), and llvm::ArrayRef< T >::size().
MDNode * MDBuilder::createFPMath | ( | float | Accuracy | ) |
Return metadata with the given settings. The special value 0.0 for the Accuracy parameter indicates the default (maximal precision) setting.
Definition at line 24 of file MDBuilder.cpp.
References llvm::MDNode::get(), llvm::ConstantFP::get(), and llvm::Type::getFloatTy().
Return metadata describing the range [Lo, Hi).
Definition at line 51 of file MDBuilder.cpp.
References llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::APInt::getBitWidth().
MDString * MDBuilder::createString | ( | StringRef | Str | ) |
Return the given string as metadata.
Definition at line 20 of file MDBuilder.cpp.
References llvm::MDString::get().
Referenced by createAliasScope(), createAliasScopeDomain(), createAnonymousAARoot(), createBranchWeights(), createTBAANode(), createTBAARoot(), createTBAAScalarTypeNode(), and createTBAAStructTypeNode().
Return metadata for a non-root TBAA node with the given name, parent in the TBAA tree, and value for 'pointsToConstantMemory'.
Definition at line 91 of file MDBuilder.cpp.
References createString(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::Type::getInt64Ty().
MDNode * MDBuilder::createTBAARoot | ( | StringRef | Name | ) |
Return metadata appropriate for a TBAA root node with the given name. This may be identified (uniqued) with other roots with the same name.
Definition at line 85 of file MDBuilder.cpp.
References createString(), and llvm::MDNode::get().
MDNode * MDBuilder::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 type DAG.
Definition at line 141 of file MDBuilder.cpp.
References createString(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::Type::getInt64Ty().
MDNode * MDBuilder::createTBAAStructNode | ( | ArrayRef< TBAAStructField > | Fields | ) |
Return metadata for a tbaa.struct node with the given struct field descriptions.
Definition at line 114 of file MDBuilder.cpp.
References llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt64Ty(), and llvm::ArrayRef< T >::size().
MDNode * MDBuilder::createTBAAStructTagNode | ( | MDNode * | BaseType, |
MDNode * | AccessType, | ||
uint64_t | Offset | ||
) |
Return metadata for a TBAA tag node with the given base type, access type and offset relative to the base type.
Definition at line 150 of file MDBuilder.cpp.
References llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::Type::getInt64Ty().
MDNode * MDBuilder::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, field type in the type DAG).
Definition at line 127 of file MDBuilder.cpp.
References createString(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::Type::getInt64Ty().