[llvm] [BOLT] fix print-mem-data not working (PR #156332)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 1 07:21:46 PDT 2025
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 cpp,h -- bolt/include/bolt/Core/MCPlusBuilder.h bolt/lib/Core/BinaryContext.cpp bolt/lib/Core/MCPlusBuilder.cpp
``````````
: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/bolt/include/bolt/Core/MCPlusBuilder.h b/bolt/include/bolt/Core/MCPlusBuilder.h
index 2bcddc826..17b7743e3 100644
--- a/bolt/include/bolt/Core/MCPlusBuilder.h
+++ b/bolt/include/bolt/Core/MCPlusBuilder.h
@@ -2190,7 +2190,8 @@ public:
}
/// Print each annotation attached to \p Inst.
- void printAnnotations(const MCInst &Inst, raw_ostream &OS, bool PrintMemData = false) const;
+ void printAnnotations(const MCInst &Inst, raw_ostream &OS,
+ bool PrintMemData = false) const;
/// Remove annotation with a given \p Index.
///
diff --git a/bolt/lib/Core/MCPlusBuilder.cpp b/bolt/lib/Core/MCPlusBuilder.cpp
index c580c548e..52475227e 100644
--- a/bolt/lib/Core/MCPlusBuilder.cpp
+++ b/bolt/lib/Core/MCPlusBuilder.cpp
@@ -378,8 +378,8 @@ void MCPlusBuilder::stripAnnotations(MCInst &Inst, bool KeepTC) const {
setTailCall(Inst);
}
-void MCPlusBuilder::printAnnotations(const MCInst &Inst,
- raw_ostream &OS, bool PrintMemData) const {
+void MCPlusBuilder::printAnnotations(const MCInst &Inst, raw_ostream &OS,
+ bool PrintMemData) const {
std::optional<unsigned> FirstAnnotationOp = getFirstAnnotationOpIndex(Inst);
if (!FirstAnnotationOp)
return;
@@ -390,7 +390,8 @@ void MCPlusBuilder::printAnnotations(const MCInst &Inst,
const int64_t Value = extractAnnotationValue(Imm);
const auto *Annotation = reinterpret_cast<const MCAnnotation *>(Value);
if (Index >= MCAnnotation::kGeneric) {
- std::string AnnotationName = AnnotationNames[Index - MCAnnotation::kGeneric];
+ std::string AnnotationName =
+ AnnotationNames[Index - MCAnnotation::kGeneric];
if (!PrintMemData && AnnotationName == "MemoryAccessProfile")
continue;
OS << " # " << AnnotationName << ": ";
``````````
</details>
https://github.com/llvm/llvm-project/pull/156332
More information about the llvm-commits
mailing list