@@ -319,7 +319,7 @@ std::string LVIRReader::getRegisterName(LVSmall Opcode,
319
319
// dbgs() << "Printing Value: " << Operands[0] << " - "
320
320
// << DbgValueRanges->getVariableName(Operands[0]) << "\n";
321
321
// });
322
- return DbgValueRanges-> getVariableName (Operands[0 ]);
322
+ return ValueNameMap. getName (Operands[0 ]);
323
323
}
324
324
325
325
llvm_unreachable (" We shouldn't actually have any other reg types here!" );
@@ -1074,8 +1074,6 @@ void LVIRReader::constructLine(LVScope *Scope, const DISubprogram *SP,
1074
1074
Line->setAddress (CurrentOffset);
1075
1075
Line->setName (Text);
1076
1076
Parent->addElement (Line);
1077
-
1078
- DbgValueRanges->addLine (I.getIterator (), CurrentOffset);
1079
1077
}
1080
1078
};
1081
1079
@@ -1901,10 +1899,12 @@ void LVIRReader::processBasicBlocks(Function &F, const DISubprogram *SP) {
1901
1899
if (options ().getPrintAnyLine ())
1902
1900
constructLine (Scope, SP, I, GenerateLineBeforePrologue);
1903
1901
1902
+ InstrLineAddrMap[I.getIterator ().getNodePtr ()] = CurrentOffset;
1903
+
1904
1904
// Update code offset.
1905
1905
updateLineOffset ();
1906
1906
}
1907
- DbgValueRanges-> addLine ( BB.end (), CurrentOffset) ;
1907
+ InstrLineAddrMap[ BB.end (). getNodePtr ()] = CurrentOffset;
1908
1908
}
1909
1909
GenerateLineBeforePrologue = false ;
1910
1910
@@ -1934,7 +1934,7 @@ void LVIRReader::processBasicBlocks(Function &F, const DISubprogram *SP) {
1934
1934
});
1935
1935
1936
1936
auto AddLocationOp = [&](Value *V, bool IsMem) {
1937
- uint64_t RegValue = DbgValueRanges-> addVariableName (V, Size );
1937
+ uint64_t RegValue = ValueNameMap. addValue (V );
1938
1938
if (IsMem)
1939
1939
Symbol->addLocationOperands (dwarf::DW_OP_bregx, {RegValue, 0 });
1940
1940
else
@@ -1970,8 +1970,10 @@ void LVIRReader::processBasicBlocks(Function &F, const DISubprogram *SP) {
1970
1970
AddLocation (DV);
1971
1971
} else {
1972
1972
for (DbgRangeEntry Entry : DbgValueRanges->getVariableRanges (DVA)) {
1973
- LVOffset Start = DbgValueRanges->getLine (Entry.Start );
1974
- LVOffset End = DbgValueRanges->getLine (Entry.End );
1973
+ // These line addresses should have already been inserted into the
1974
+ // InstrLineAddrMap, so we assume they are present here.
1975
+ LVOffset Start = InstrLineAddrMap.at (Entry.Start .getNodePtr ());
1976
+ LVOffset End = InstrLineAddrMap.at (Entry.End .getNodePtr ());
1975
1977
Symbol->addLocation (llvm::dwarf::DW_AT_location, Start, End,
1976
1978
/* SectionOffset=*/ 0 , /* OffsetOnEntry=*/ 0 );
1977
1979
DbgValueDef DV = Entry.Value ;
0 commit comments