- if (NeedsAbsoluteFilePath && sys::path::is_relative(FileName)) {
- // We may still need to append compilation directory of compile unit.
- SmallString<16> AbsolutePath;
- if (const char *CompilationDir = CU->getCompilationDir()) {
- sys::path::append(AbsolutePath, CompilationDir);
- }
- sys::path::append(AbsolutePath, FileName);
- FileName = AbsolutePath.str();
- }
- return true;
-}
-
-static bool getFileLineInfoForCompileUnit(DWARFCompileUnit *CU,
- const DWARFLineTable *LineTable,
- uint64_t Address,
- bool NeedsAbsoluteFilePath,
- std::string &FileName,
- uint32_t &Line, uint32_t &Column) {
- if (CU == 0 || LineTable == 0)
- return false;
- // Get the index of row we're looking for in the line table.
- uint32_t RowIndex = LineTable->lookupAddress(Address);
- if (RowIndex == -1U)
- return false;
- // Take file number and line/column from the row.
- const DWARFDebugLine::Row &Row = LineTable->Rows[RowIndex];
- if (!getFileNameForCompileUnit(CU, LineTable, Row.File,
- NeedsAbsoluteFilePath, FileName))
+ // The address may correspond to instruction in some inlined function,
+ // so we have to build the chain of inlined functions and take the
+ // name of the topmost function in it.
+ const DWARFDebugInfoEntryInlinedChain &InlinedChain =
+ CU->getInlinedChainForAddress(Address);
+ if (InlinedChain.DIEs.size() == 0)