LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
llvm::MDBuilder Class Reference

#include <MDBuilder.h>

Classes

struct  TBAAStructField
 

Public Member Functions

 MDBuilder (LLVMContext &context)
 
MDStringcreateString (StringRef Str)
 Return the given string as metadata. More...
 
MDNodecreateFPMath (float Accuracy)
 Return metadata with the given settings. The special value 0.0 for the Accuracy parameter indicates the default (maximal precision) setting. More...
 
MDNodecreateBranchWeights (uint32_t TrueWeight, uint32_t FalseWeight)
 Return metadata containing two branch weights. More...
 
MDNodecreateBranchWeights (ArrayRef< uint32_t > Weights)
 Return metadata containing a number of branch weights. More...
 
MDNodecreateRange (const APInt &Lo, const APInt &Hi)
 Return metadata describing the range [Lo, Hi). More...
 
MDNodecreateAnonymousTBAARoot ()
 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. More...
 
MDNodecreateTBAARoot (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. More...
 
MDNodecreateTBAANode (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'. More...
 
MDNodecreateTBAAStructNode (ArrayRef< TBAAStructField > Fields)
 Return metadata for a tbaa.struct node with the given struct field descriptions. More...
 
MDNodecreateTBAAStructTypeNode (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). More...
 
MDNodecreateTBAAScalarTypeNode (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. More...
 
MDNodecreateTBAAStructTagNode (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. More...
 

Detailed Description

Definition at line 27 of file MDBuilder.h.

Constructor & Destructor Documentation

llvm::MDBuilder::MDBuilder ( LLVMContext context)
inline

Definition at line 31 of file MDBuilder.h.

Member Function Documentation

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 102 of file MDBuilder.h.

References llvm::MDNode::deleteTemporary(), llvm::NVPTXISD::Dummy, llvm::MDNode::get(), llvm::MDNode::getTemporary(), and llvm::MDNode::replaceOperandWith().

MDNode* llvm::MDBuilder::createBranchWeights ( uint32_t  TrueWeight,
uint32_t  FalseWeight 
)
inline

Return metadata containing two branch weights.

Definition at line 58 of file MDBuilder.h.

MDNode* llvm::MDBuilder::createBranchWeights ( ArrayRef< uint32_t >  Weights)
inline

Return metadata containing a number of branch weights.

Definition at line 64 of file MDBuilder.h.

References createString(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), Int32Ty, and llvm::ArrayRef< T >::size().

MDNode* llvm::MDBuilder::createFPMath ( float  Accuracy)
inline

Return metadata with the given settings. The special value 0.0 for the Accuracy parameter indicates the default (maximal precision) setting.

Definition at line 45 of file MDBuilder.h.

References llvm::MDNode::get(), llvm::ConstantFP::get(), and llvm::Type::getFloatTy().

MDNode* llvm::MDBuilder::createRange ( const APInt Lo,
const APInt Hi 
)
inline

Return metadata describing the range [Lo, Hi).

Definition at line 82 of file MDBuilder.h.

References llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::APInt::getBitWidth().

MDString* llvm::MDBuilder::createString ( StringRef  Str)
inline

Return the given string as metadata.

Definition at line 34 of file MDBuilder.h.

References llvm::MDString::get().

Referenced by createBranchWeights(), createTBAANode(), createTBAARoot(), createTBAAScalarTypeNode(), and createTBAAStructTypeNode().

MDNode* llvm::MDBuilder::createTBAANode ( StringRef  Name,
MDNode Parent,
bool  isConstant = false 
)
inline

Return metadata for a non-root TBAA node with the given name, parent in the TBAA tree, and value for 'pointsToConstantMemory'.

Definition at line 126 of file MDBuilder.h.

References createString(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::Type::getInt64Ty().

MDNode* llvm::MDBuilder::createTBAARoot ( StringRef  Name)
inline

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 120 of file MDBuilder.h.

References createString(), and llvm::MDNode::get().

MDNode* llvm::MDBuilder::createTBAAScalarTypeNode ( StringRef  Name,
MDNode Parent,
uint64_t  Offset = 0 
)
inline

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 175 of file MDBuilder.h.

References createString(), llvm::IntegerType::get(), llvm::ConstantInt::get(), and llvm::MDNode::get().

MDNode* llvm::MDBuilder::createTBAAStructNode ( ArrayRef< TBAAStructField Fields)
inline

Return metadata for a tbaa.struct node with the given struct field descriptions.

Definition at line 148 of file MDBuilder.h.

References llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), and llvm::ArrayRef< T >::size().

MDNode* llvm::MDBuilder::createTBAAStructTagNode ( MDNode BaseType,
MDNode AccessType,
uint64_t  Offset 
)
inline

Return metadata for a TBAA tag node with the given base type, access type and offset relative to the base type.

Definition at line 187 of file MDBuilder.h.

References llvm::IntegerType::get(), llvm::ConstantInt::get(), and llvm::MDNode::get().

MDNode* llvm::MDBuilder::createTBAAStructTypeNode ( StringRef  Name,
ArrayRef< std::pair< MDNode *, uint64_t > >  Fields 
)
inline

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 161 of file MDBuilder.h.

References createString(), llvm::IntegerType::get(), llvm::ConstantInt::get(), and llvm::MDNode::get().


The documentation for this class was generated from the following file: