diff options
author | George Rimar <grimar@accesssoftek.com> | 2018-07-16 15:29:35 +0000 |
---|---|---|
committer | George Rimar <grimar@accesssoftek.com> | 2018-07-16 15:29:35 +0000 |
commit | adbc17043719757a8fef929c7afdf503b7d8205d (patch) | |
tree | 056ec064030678906c1945d7dfe10ce105a5ce6a /lld/ELF/InputSection.cpp | |
parent | 607d70c9bc5fd37093f6077312a79ad66e094b98 (diff) |
[ELF] - Eliminate ObjFile<ELFT>::getLineInfo. NFC.
Flow is the same, but a bit shorter after this change.
Diffstat (limited to 'lld/ELF/InputSection.cpp')
-rw-r--r-- | lld/ELF/InputSection.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 1f963e6ec5e..1c98fbdeb8e 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -221,9 +221,8 @@ std::string InputSectionBase::getLocation(uint64_t Offset) { .str(); // First check if we can get desired values from debugging information. - std::string LineInfo = getFile<ELFT>()->getLineInfo(this, Offset); - if (!LineInfo.empty()) - return LineInfo; + if (Optional<DILineInfo> Info = getFile<ELFT>()->getDILineInfo(this, Offset)) + return Info->FileName + ":" + std::to_string(Info->Line); // File->SourceFile contains STT_FILE symbol that contains a // source file name. If it's missing, we use an object file name. |