llvm::DILocalScope::cloneScopeForSubprogram

Traverses the scope chain rooted at RootScope until it hits a Subprogram, recreating the chain with "NewSP" instead.

Synopsis

Declared in <llvm/IR/DebugInfoMetadata.h>

static
DILocalScope*
cloneScopeForSubprogram(
    DILocalScope& RootScope,
    DISubprogram& NewSP,
    LLVMContext& Ctx,
    DenseMap<MDNode const*, MDNode*>& Cache);

Return Value

traverses the scope chain rooted at RootScope until it hits a Subprogram,.

Parameters

NameDescription
RootScopeRoot local scope to clone.
NewSPSubprogram that owns the cloned scope chain.
CtxLLVM context for newly created scope nodes.
CacheMap from old scopes to already-cloned scopes.