mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
DI: Use a DenseMap
instead of named metadata, NFC
Remove a strange round-trip through named metadata to assign preserved local variables to their subprograms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -73,13 +73,10 @@ void DIBuilder::finalize() {
|
||||
DIType(TempSubprograms).replaceAllUsesWith(SPs);
|
||||
for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++i) {
|
||||
DISubprogram SP(SPs.getElement(i));
|
||||
SmallVector<Value *, 4> Variables;
|
||||
if (NamedMDNode *NMD = getFnSpecificMDNode(M, SP)) {
|
||||
for (unsigned ii = 0, ee = NMD->getNumOperands(); ii != ee; ++ii)
|
||||
Variables.push_back(NMD->getOperand(ii));
|
||||
NMD->eraseFromParent();
|
||||
}
|
||||
if (MDNode *Temp = SP.getVariablesNodes()) {
|
||||
SmallVector<Value *, 4> Variables;
|
||||
for (Value *V : PreservedVariables.lookup(SP))
|
||||
Variables.push_back(V);
|
||||
DIArray AV = getOrCreateArray(Variables);
|
||||
DIType(Temp).replaceAllUsesWith(AV);
|
||||
}
|
||||
@ -906,8 +903,8 @@ DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
||||
// to preserve variable info in such situation then stash it in a
|
||||
// named mdnode.
|
||||
DISubprogram Fn(getDISubprogram(Scope));
|
||||
NamedMDNode *FnLocals = getOrInsertFnSpecificMDNode(M, Fn);
|
||||
FnLocals->addOperand(Node);
|
||||
assert(Fn && "Missing subprogram for local variable");
|
||||
PreservedVariables[Fn].push_back(Node);
|
||||
}
|
||||
DIVariable RetVar(Node);
|
||||
assert(RetVar.isVariable() &&
|
||||
|
Reference in New Issue
Block a user