[NFC][llvm-exegesis] Ensure that target options show up in --help
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 21 Dec 2022 00:38:10 +0000 (03:38 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 21 Dec 2022 00:38:30 +0000 (03:38 +0300)
Fixes https://github.com/llvm/llvm-project/issues/59377

llvm/tools/llvm-exegesis/lib/Target.cpp
llvm/tools/llvm-exegesis/lib/Target.h
llvm/tools/llvm-exegesis/lib/X86/Target.cpp
llvm/tools/llvm-exegesis/llvm-exegesis.cpp

index 1ee5b31..8c6275b 100644 (file)
 namespace llvm {
 namespace exegesis {
 
+cl::OptionCategory Options("llvm-exegesis options");
+cl::OptionCategory BenchmarkOptions("llvm-exegesis benchmark options");
+cl::OptionCategory AnalysisOptions("llvm-exegesis analysis options");
+
 ExegesisTarget::~ExegesisTarget() {} // anchor.
 
 static ExegesisTarget *FirstTarget = nullptr;
index 9487869..3d631b9 100644 (file)
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Error.h"
 
 namespace llvm {
 namespace exegesis {
 
+extern cl::OptionCategory Options;
+extern cl::OptionCategory BenchmarkOptions;
+extern cl::OptionCategory AnalysisOptions;
+
 struct PfmCountersInfo {
   // An optional name of a performance counter that can be used to measure
   // cycles.
index b148574..5344cfa 100644 (file)
@@ -38,9 +38,6 @@
 namespace llvm {
 namespace exegesis {
 
-static cl::OptionCategory
-    BenchmarkOptions("llvm-exegesis benchmark x86-options");
-
 // If a positive value is specified, we are going to use the LBR in
 // latency-mode.
 //
index 04aac6a..646c46c 100644 (file)
 namespace llvm {
 namespace exegesis {
 
-static cl::OptionCategory Options("llvm-exegesis options");
-static cl::OptionCategory BenchmarkOptions("llvm-exegesis benchmark options");
-static cl::OptionCategory AnalysisOptions("llvm-exegesis analysis options");
-
 static cl::opt<int> OpcodeIndex(
     "opcode-index",
     cl::desc("opcode to measure, by index, or -1 to measure all opcodes"),