[llvm] [BOLT] Reduce CFI warning verbosity (PR #105336)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 13:28:18 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: Maksim Panchenko (maksfb)

<details>
<summary>Changes</summary>

CFI programs may have more saves than restores and this is completely benign from BOLT's perspective. Reduce the verbosity and print the warning only under `-v=1` and above.

---
Full diff: https://github.com/llvm/llvm-project/pull/105336.diff


1 Files Affected:

- (modified) bolt/lib/Core/BinaryFunction.cpp (+1-1) 


``````````diff
diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index e5c6d551e42a7a..af982fd60b17e7 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -2502,7 +2502,7 @@ void BinaryFunction::annotateCFIState() {
     }
   }
 
-  if (!StateStack.empty()) {
+  if (opts::Verbosity >= 1 && !StateStack.empty()) {
     BC.errs() << "BOLT-WARNING: non-empty CFI stack at the end of " << *this
               << '\n';
   }

``````````

</details>


https://github.com/llvm/llvm-project/pull/105336


More information about the llvm-commits mailing list