[llvm-branch-commits] [llvm-profgen] Support [buildid:]addr in unsymbolized profile context (PR #194205)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sat Apr 25 22:50:21 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- llvm/include/llvm/ProfileData/SampleProf.h llvm/tools/llvm-profgen/PerfReader.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/ProfileData/SampleProf.h b/llvm/include/llvm/ProfileData/SampleProf.h
index a331a788c..39278d87d 100644
--- a/llvm/include/llvm/ProfileData/SampleProf.h
+++ b/llvm/include/llvm/ProfileData/SampleProf.h
@@ -603,10 +603,9 @@ public:
/// `buildid:` prefixes; non-matching frames become 0x0.
/// Returns true if the leaf (first) frame's buildid matches or no
/// filter is set, false if the leaf is external (non-matching buildid).
- static bool
- createCtxVectorFromStr(StringRef ContextStr,
- SampleContextFrameVector &Context,
- StringRef FilterBuildID = StringRef()) {
+ static bool createCtxVectorFromStr(StringRef ContextStr,
+ SampleContextFrameVector &Context,
+ StringRef FilterBuildID = StringRef()) {
// Remove encapsulating '[' and ']' if any
ContextStr = ContextStr.substr(1, ContextStr.size() - 2);
StringRef ContextRemain = ContextStr;
diff --git a/llvm/tools/llvm-profgen/PerfReader.cpp b/llvm/tools/llvm-profgen/PerfReader.cpp
index ee3cfffec..0b05a0efb 100644
--- a/llvm/tools/llvm-profgen/PerfReader.cpp
+++ b/llvm/tools/llvm-profgen/PerfReader.cpp
@@ -1040,8 +1040,7 @@ void UnsymbolizedProfileReader::readUnsymbolizedProfile(StringRef FileName) {
TraceIt.advance();
if (!LeafIsInternal) {
// Skip ranges and branches for non-matching leaf buildid.
- while (!TraceIt.isAtEoF() &&
- !TraceIt.getCurrentLine().starts_with("["))
+ while (!TraceIt.isAtEoF() && !TraceIt.getCurrentLine().starts_with("["))
TraceIt.advance();
continue;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/194205
More information about the llvm-branch-commits
mailing list