diff options
| author | Pete Cooper <peter_cooper@apple.com> | 2016-07-22 01:41:32 +0000 |
|---|---|---|
| committer | Pete Cooper <peter_cooper@apple.com> | 2016-07-22 01:41:32 +0000 |
| commit | b2ba776aedf88c8a1f7c66d444fac38a33900897 (patch) | |
| tree | cc6e86eeaf0b813b46482a4e0421ae989cb7176b /llvm/lib/DebugInfo | |
| parent | 8258686922244ffcddf4a9d6f8b5dfc7b84c3089 (diff) | |
| download | bcm5719-llvm-b2ba776aedf88c8a1f7c66d444fac38a33900897.tar.gz bcm5719-llvm-b2ba776aedf88c8a1f7c66d444fac38a33900897.zip | |
Avoid dsymutil calls to getFileNameByIndex.
This change adds a hasFileAtIndex method. getChildDeclContext can first call this method, and if it returns true it knows it can then lookup the resolved path cache for the given file index. If we hit that cache then we don't even have to call getFileNameByIndex.
Running dsymutil against the swift executable built from github gives a 20% performance improvement without any change in the binary.
Differential Revision: https://reviews.llvm.org/D22655
Reviewed by friss.
llvm-svn: 276380
Diffstat (limited to 'llvm/lib/DebugInfo')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp index 30cb83398dd..63d22d84121 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp @@ -624,12 +624,17 @@ bool DWARFDebugLine::LineTable::lookupAddressRange( return true; } -bool DWARFDebugLine::LineTable::getFileNameByIndex(uint64_t FileIndex, - const char *CompDir, - FileLineInfoKind Kind, - std::string &Result) const { - if (FileIndex == 0 || FileIndex > Prologue.FileNames.size() || - Kind == FileLineInfoKind::None) +bool +DWARFDebugLine::LineTable::hasFileAtIndex(uint64_t FileIndex) const { + return FileIndex != 0 && FileIndex <= Prologue.FileNames.size(); +} + +bool +DWARFDebugLine::LineTable::getFileNameByIndex(uint64_t FileIndex, + const char *CompDir, + FileLineInfoKind Kind, + std::string &Result) const { + if (Kind == FileLineInfoKind::None || !hasFileAtIndex(FileIndex)) return false; const FileNameEntry &Entry = Prologue.FileNames[FileIndex - 1]; const char *FileName = Entry.Name; |

