21 MDFunctionLocalContext *NewMD =
35 if (SeenInlineeContexts.
insert(InlinedCall.InlineeContext).second)
36 Nodes.
push_back(InlinedCall.InlineeContext);
41 : FLContext(FLContext) {
42 assert(!FLContext->isNonDebug() &&
43 "Trying to build debug info in a NonDebug FLContext?");
44 assert(SP &&
"FLMDBuilder requires a valid DISubprogram");
46 (FLContext->getScopes().empty() || FLContext->getScope(0).Scope == SP) &&
47 "FLContext already contains non-matching subprogram?");
50 if (FLContext->getScopes().empty()) {
51 assert(FLContext->getSrcLocs().empty() &&
52 FLContext->getInlinedCalls().empty() &&
53 "FLContext contains SrcLocs or InlinedCalls without Scopes?");
61 for (
auto [Idx, SrcLoc] :
enumerate(FLContext->getSrcLocs()))
62 SrcLocMap.insert({SrcLoc, Idx});
63 for (
auto [Idx, Scope] :
enumerate(FLContext->getScopes()))
64 ScopeMap.insert({Scope, Idx});
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Subprogram description. Uses SubclassData1.
FLIndex< FLSrcLoc > getSrcLoc(uint32_t Line, uint16_t Column, FLIndex< FLScope > ScopeIdx)
FLIndex< FLScope > getScope(const DILocalScope *Scope)
LLVM_ABI FLMDBuilder(MDFunctionLocalContext *FLContext, const DISubprogram *SP)
This is an important class for using LLVM in a threaded context.
Storage class for function-local metadata objects.
ArrayRef< FLInlinedCall > getInlinedCalls() const
LLVM_ABI void getUsedMDNodes(SmallVectorImpl< const MDNode * > &Nodes) const
ArrayRef< FLScope > getScopes() const
static LLVM_ABI MDFunctionLocalContext * getDistinct(LLVMContext &Context, bool NonDebug=false)
LLVM_ABI void storeDistinctInContext()
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is an optimization pass for GlobalISel generic memory operations.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...