class MDBuilder

Declaration

class MDBuilder { /* full declaration omitted */ };

Declared at: llvm/include/llvm/IR/MDBuilder.h:35

Method Overview

Methods

MDBuilder(llvm::LLVMContext& context)

Declared at: llvm/include/llvm/IR/MDBuilder.h:39

Parameters

llvm::LLVMContext& context

llvm::MDNode* createAliasScope(
    llvm::StringRef Name,
    llvm::MDNode* Domain)

Description

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.

Declared at: llvm/include/llvm/IR/MDBuilder.h:159

Parameters

llvm::StringRef Name
llvm::MDNode* Domain

llvm::MDNode* createAliasScopeDomain(
    llvm::StringRef Name)

Description

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.

Declared at: llvm/include/llvm/IR/MDBuilder.h:154

Parameters

llvm::StringRef Name

llvm::MDNode* createAnonymousAARoot(
    llvm::StringRef Name = llvm::StringRef(),
    llvm::MDNode* Extra = nullptr)

Description

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.

Declared at: llvm/include/llvm/IR/MDBuilder.h:120

Parameters

llvm::StringRef Name = llvm::StringRef()
llvm::MDNode* Extra = nullptr

llvm::MDNode* createAnonymousAliasScope(
    llvm::MDNode* Domain,
    llvm::StringRef Name = llvm::StringRef())

Description

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.

Declared at: llvm/include/llvm/IR/MDBuilder.h:141

Parameters

llvm::MDNode* Domain
llvm::StringRef Name = llvm::StringRef()

llvm::MDNode* createAnonymousAliasScopeDomain(
    llvm::StringRef Name = llvm::StringRef())

Description

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.

Declared at: llvm/include/llvm/IR/MDBuilder.h:134

Parameters

llvm::StringRef Name = llvm::StringRef()

llvm::MDNode* createAnonymousTBAARoot()

Description

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.

Declared at: llvm/include/llvm/IR/MDBuilder.h:127

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

Description

Return metadata containing two branch weights.

Declared at: llvm/include/llvm/IR/MDBuilder.h:61

Parameters

uint32_t TrueWeight
uint32_t FalseWeight

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

Description

Return metadata containing a number of branch weights.

Declared at: llvm/include/llvm/IR/MDBuilder.h:64

Parameters

ArrayRef<uint32_t> Weights

llvm::MDNode* createCallbackEncoding(
    unsigned int CalleeArgNo,
    ArrayRef<int> Arguments,
    bool VarArgsArePassed)

Description

Return metadata describing a callback (see llvm::AbstractCallSite).

Declared at: llvm/include/llvm/IR/MDBuilder.h:106

Parameters

unsigned int CalleeArgNo
ArrayRef<int> Arguments
bool VarArgsArePassed

llvm::MDNode* createCallees(
    ArrayRef<llvm::Function*> Callees)

Description

Return metadata indicating the possible callees of indirect calls.

Declared at: llvm/include/llvm/IR/MDBuilder.h:99

Parameters

ArrayRef<llvm::Function*> Callees

llvm::ConstantAsMetadata* createConstant(
    llvm::Constant* C)

Description

Return the given constant as metadata.

Declared at: llvm/include/llvm/IR/MDBuilder.h:45

Parameters

llvm::Constant* C

llvm::MDNode* createFPMath(float Accuracy)

Description

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

Declared at: llvm/include/llvm/IR/MDBuilder.h:54

Parameters

float Accuracy

llvm::MDNode* createFunctionEntryCount(
    uint64_t Count,
    bool Synthetic,
    const DenseSet<GlobalValue::GUID>* Imports)

Description

Return metadata containing the entry \p Count for a function, a boolean\Syntheticindicating whether the counts were synthetized, and the GUIDs stored in \p Imports that need to be imported for sample PGO, to enable the same inlines as the profiled optimized binary

Declared at: llvm/include/llvm/IR/MDBuilder.h:73

Parameters

uint64_t Count
bool Synthetic
const DenseSet<GlobalValue::GUID>* Imports

llvm::MDNode* createFunctionSectionPrefix(
    llvm::StringRef Prefix)

Description

Return metadata containing the section prefix for a function.

Declared at: llvm/include/llvm/IR/MDBuilder.h:77

Parameters

llvm::StringRef Prefix

llvm::MDNode* createIrrLoopHeaderWeight(
    uint64_t Weight)

Description

Return metadata containing an irreducible loop header weight.

Declared at: llvm/include/llvm/IR/MDBuilder.h:213

Parameters

uint64_t Weight

llvm::MDNode* createMisExpect(
    uint64_t Index,
    uint64_t LikelyWeight,
    uint64_t UnlikelyWeight)

Description

return metadata containing expected value

Declared at: llvm/include/llvm/IR/MDBuilder.h:80

Parameters

uint64_t Index
uint64_t LikelyWeight
uint64_t UnlikelyWeight

llvm::MDNode* createMutableTBAAAccessTag(
    llvm::MDNode* Tag)

Description

Return mutable version of the given mutable or immutable TBAA access tag.

Declared at: llvm/include/llvm/IR/MDBuilder.h:210

Parameters

llvm::MDNode* Tag

llvm::MDNode* createRange(llvm::Constant* Lo,
                          llvm::Constant* Hi)

Description

Return metadata describing the range [Lo, Hi).

Declared at: llvm/include/llvm/IR/MDBuilder.h:91

Parameters

llvm::Constant* Lo
llvm::Constant* Hi

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

Description

Return metadata describing the range [Lo, Hi).

Declared at: llvm/include/llvm/IR/MDBuilder.h:88

Parameters

const llvm::APInt& Lo
const llvm::APInt& Hi

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

Description

Return the given string as metadata.

Declared at: llvm/include/llvm/IR/MDBuilder.h:42

Parameters

llvm::StringRef Str

llvm::MDNode* createTBAAAccessTag(
    llvm::MDNode* BaseType,
    llvm::MDNode* AccessType,
    uint64_t Offset,
    uint64_t Size,
    bool IsImmutable = false)

Description

Return metadata for a TBAA access tag with the given base type, final access type, offset of the access relative to the base type, size of the access and flag indicating whether the accessed object can be considered immutable for the purposes of the TBAA analysis.

Declared at: llvm/include/llvm/IR/MDBuilder.h:204

Parameters

llvm::MDNode* BaseType
llvm::MDNode* AccessType
uint64_t Offset
uint64_t Size
bool IsImmutable = false

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

Description

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

Declared at: llvm/include/llvm/IR/MDBuilder.h:163

Parameters

llvm::StringRef Name
llvm::MDNode* Parent
bool isConstant = false

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

Description

Return metadata appropriate for a TBAA root node with the given name. This may be identified (uniqued) with other roots with the same name.

Declared at: llvm/include/llvm/IR/MDBuilder.h:149

Parameters

llvm::StringRef Name

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

Description

Return metadata for a TBAA scalar type node with the given name, an offset and a parent in the TBAA type DAG.

Declared at: llvm/include/llvm/IR/MDBuilder.h:186

Parameters

llvm::StringRef Name
llvm::MDNode* Parent
uint64_t Offset = 0

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

Description

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

Declared at: llvm/include/llvm/IR/MDBuilder.h:176

Parameters

ArrayRef<llvm::MDBuilder::TBAAStructField> Fields

llvm::MDNode* createTBAAStructTagNode(
    llvm::MDNode* BaseType,
    llvm::MDNode* AccessType,
    uint64_t Offset,
    bool IsConstant = false)

Description

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

Declared at: llvm/include/llvm/IR/MDBuilder.h:191

Parameters

llvm::MDNode* BaseType
llvm::MDNode* AccessType
uint64_t Offset
bool IsConstant = false

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

Description

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).

Declared at: llvm/include/llvm/IR/MDBuilder.h:181

Parameters

llvm::StringRef Name
ArrayRef<std::pair<MDNode*, uint64_t>> Fields

llvm::MDNode* createTBAATypeNode(
    llvm::MDNode* Parent,
    uint64_t Size,
    llvm::Metadata* Id,
    ArrayRef<llvm::MDBuilder::TBAAStructField>
        Fields = llvm::ArrayRef<
            llvm::MDBuilder::TBAAStructField>())

Description

Return metadata for a TBAA type node in the TBAA type DAG with the given parent type, size in bytes, type identifier and a list of fields.

Declared at: llvm/include/llvm/IR/MDBuilder.h:196

Parameters

llvm::MDNode* Parent
uint64_t Size
llvm::Metadata* Id
ArrayRef<llvm::MDBuilder::TBAAStructField> Fields = llvm::ArrayRef<llvm::MDBuilder::TBAAStructField>()

llvm::MDNode* createUnpredictable()

Description

Return metadata specifying that a branch or switch is unpredictable.

Declared at: llvm/include/llvm/IR/MDBuilder.h:67

llvm::MDNode* mergeCallbackEncodings(
    llvm::MDNode* ExistingCallbacks,
    llvm::MDNode* NewCB)

Description

Merge the new callback encoding \p NewCB into \p ExistingCallbacks.

Declared at: llvm/include/llvm/IR/MDBuilder.h:110

Parameters

llvm::MDNode* ExistingCallbacks
llvm::MDNode* NewCB