LLVM 24.0.0git
llvm::FLMDBuilder Class Reference

Builder class used to more efficiently insert new entries into an MDFunctionLocalContext, using maps to perform uniquing instead of linear search. More...

#include "llvm/IR/FunctionLocalMetadata.h"

Public Member Functions

FLIndex< FLScope > getScope (const DILocalScope *Scope)
FLIndex< FLSrcLoc > getSrcLoc (uint32_t Line, uint16_t Column, FLIndex< FLScope > ScopeIdx)
FLIndex< FLSrcLoc > getSrcLocWithScope (uint32_t Line, uint16_t Column, const DILocalScope *Scope)
LLVM_ABI FLMDBuilder (MDFunctionLocalContext *FLContext, const DISubprogram *SP)

Detailed Description

Builder class used to more efficiently insert new entries into an MDFunctionLocalContext, using maps to perform uniquing instead of linear search.

If inserting into an empty MDFunctionLocalContext, also performs initial insertions of the DISubprogram, and of SrcLocs for Line={0, SP->getLine(), SP->getScopeLine()} at top-level scope, as these are likely to be requested by optimizations later on.

Definition at line 416 of file FunctionLocalMetadata.h.

Constructor & Destructor Documentation

◆ FLMDBuilder()

FLMDBuilder::FLMDBuilder ( MDFunctionLocalContext * FLContext,
const DISubprogram * SP )

If there are no existing FLMD entries, create the required DISubprogram scope and then insert some commonly-required srclocs.

Otherwise, load all existing FLMD entries into the builder map.

Definition at line 39 of file FunctionLocalMetadata.cpp.

References assert(), llvm::enumerate(), getScope(), and getSrcLoc().

Member Function Documentation

◆ getScope()

FLIndex< FLScope > llvm::FLMDBuilder::getScope ( const DILocalScope * Scope)
inline

Definition at line 425 of file FunctionLocalMetadata.h.

Referenced by FLMDBuilder(), and getSrcLocWithScope().

◆ getSrcLoc()

FLIndex< FLSrcLoc > llvm::FLMDBuilder::getSrcLoc ( uint32_t Line,
uint16_t Column,
FLIndex< FLScope > ScopeIdx )
inline

Definition at line 435 of file FunctionLocalMetadata.h.

Referenced by FLMDBuilder(), and getSrcLocWithScope().

◆ getSrcLocWithScope()

FLIndex< FLSrcLoc > llvm::FLMDBuilder::getSrcLocWithScope ( uint32_t Line,
uint16_t Column,
const DILocalScope * Scope )
inline

Definition at line 446 of file FunctionLocalMetadata.h.

References getScope(), and getSrcLoc().


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