[PATCH] D112282: [llvm-profgen] Switch to DWARF-based symbol and ranges

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 11:53:29 PDT 2021


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfiledBinary.h:355
     I--;
-    return {I->first, I->second.second};
+    return &I->second;
+  }
----------------
wlei wrote:
> hoy wrote:
> > assert `Offset` falls into the range started by the start address?
> The `upper_bound` will assure `Offset >= StartOffset`.
> 
> Do you mean to assert (Offset <= EndOffset & "..."); ? This sounds a good place, with this, we don't need https://reviews.llvm.org/D111902 then.
I found that there're some lib code in the bottom of the section which will cause the assertion failure.

So I added the code below to filter out them.
```
    if (Offset > I->second.EndOffset)
      return nullptr;
```

With this, it should guarantee the offset fall into the right range.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112282/new/

https://reviews.llvm.org/D112282



More information about the llvm-commits mailing list