With this patch lld will iterate over compile units to file the line tables instead of assuming there is only one at offset 0.
Details
Diff Detail
Event Timeline
ELF/InputFiles.cpp | ||
---|---|---|
139 | Maybe use .get() instead of &*? |
It turns out this can be simplified slightly. I attached the patch.
ELF/InputFiles.cpp | ||
---|---|---|
131 | Code above duplicates code from DWARFContext::getLineTableForUnit. We could have DWARFContext as a member of ObjectFile. And here it could be just: template <class ELFT> void ObjFile<ELFT>::initializeDwarf() { Dwarf = llvm::make_unique<DWARFContext>( llvm::make_unique<LLDDwarfObj<ELFT>>(this)); for (std::unique_ptr<DWARFCompileUnit> &CU : Dwarf->compile_units()) { const DWARFDebugLine::LineTable *LT = Dwarf->getLineTableForUnit(CU.get()); ... | |
197 | getFileLineInfoForAddress returns true on success according to specification. for (const llvm::DWARFDebugLine::LineTable *LT : LineTables) if (LT->getFileLineInfoForAddress( S->getOffsetInFile() + Offset, nullptr, DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info)) return Info; |
ELF/InputFiles.h | ||
---|---|---|
20 | I don't think it is possible to forward declare an inner class (llvm::DWARFDebugLine::LineTable). |
Do we need this header here? All I see that has changed is the use of pointers in a vector, which can be forward declared, can't they?