[dsymutil] Fix caching of current range. NFC.
authorFrederic Riss <friss@apple.com>
Mon, 31 Aug 2015 05:09:26 +0000 (05:09 +0000)
committerFrederic Riss <friss@apple.com>
Mon, 31 Aug 2015 05:09:26 +0000 (05:09 +0000)
The current range cache will will just be hit more often, no
visible external change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246409 91177308-0d34-0410-b5e6-96231b3b80d8

tools/dsymutil/DwarfLinker.cpp

index 1e171db44c4e4fc36942ac223d08ebfbc6bca85a..6881eab9c3522edc972ed2f512ef2926e038d542 100644 (file)
@@ -2640,8 +2640,9 @@ void DwarfLinker::patchRangesForUnit(const CompileUnit &Unit,
     const auto &Entries = RangeList.getEntries();
     const DWARFDebugRangeList::RangeListEntry &First = Entries.front();
 
-    if (CurrRange == InvalidRange || First.StartAddress < CurrRange.start() ||
-        First.StartAddress >= CurrRange.stop()) {
+    if (CurrRange == InvalidRange ||
+        First.StartAddress + OrigLowPc < CurrRange.start() ||
+        First.StartAddress + OrigLowPc >= CurrRange.stop()) {
       CurrRange = FunctionRanges.find(First.StartAddress + OrigLowPc);
       if (CurrRange == InvalidRange ||
           CurrRange.start() > First.StartAddress + OrigLowPc) {