[llvm] 0f77887 - [llvm-exegesis] Fix a warning

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 13 09:41:46 PDT 2025


Author: Kazu Hirata
Date: 2025-08-13T09:41:40-07:00
New Revision: 0f7788710884ed95d104423cf16e3393405ecdd1

URL: https://github.com/llvm/llvm-project/commit/0f7788710884ed95d104423cf16e3393405ecdd1
DIFF: https://github.com/llvm/llvm-project/commit/0f7788710884ed95d104423cf16e3393405ecdd1.diff

LOG: [llvm-exegesis] Fix a warning

This patch fixes:

  llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp:602:6: error:
  unused function 'printInstructions' [-Werror,-Wunused-function]

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
index 2c9d6dc4ba13a..1fd0a15dcfa91 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -598,6 +598,7 @@ struct InstructionInfo {
   std::string HexBytes;
 };
 
+#ifndef NDEBUG
 // Helper function to print generated assembly snippets
 void printInstructions(const std::vector<InstructionInfo> &Instructions,
                        int InitialLinesCount, int LastLinesCount) {
@@ -622,6 +623,7 @@ void printInstructions(const std::vector<InstructionInfo> &Instructions,
            << Instructions[i].HexBytes << Instructions[i].Text << '\n';
   dbgs() << "```\n";
 }
+#endif // NDEBUG
 
 // Function to extract and print assembly from snippet
 Error printAssembledSnippet(const LLVMState &State,


        


More information about the llvm-commits mailing list