mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Use separate named MDNode to hold each function's local variable info.
This speeds up local variable handling in DwarfDebug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1053,8 +1053,12 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
|
||||
// The optimizer may remove local variable. If there is an interest
|
||||
// to preserve variable info in such situation then stash it in a
|
||||
// named mdnode.
|
||||
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.lv");
|
||||
NMD->addOperand(Node);
|
||||
DISubprogram Fn(getDISubprogram(Context));
|
||||
const Twine FnLVName = Twine("llvm.dbg.lv.", Fn.getName());
|
||||
NamedMDNode *FnLocals = M.getNamedMetadataUsingTwine(FnLVName);
|
||||
if (!FnLocals)
|
||||
FnLocals = NamedMDNode::Create(VMContext, FnLVName, NULL, 0, &M);
|
||||
FnLocals->addOperand(Node);
|
||||
}
|
||||
return DIVariable(Node);
|
||||
}
|
||||
|
Reference in New Issue
Block a user