[llvm] 7f3dcf4 - [ctx_prof] Don't use `GENERATE_DRIVER` (#100777)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 26 12:59:46 PDT 2024


Author: Mircea Trofin
Date: 2024-07-26T15:59:43-04:00
New Revision: 7f3dcf4b2e1001c829ec431996d4ee2662a229fa

URL: https://github.com/llvm/llvm-project/commit/7f3dcf4b2e1001c829ec431996d4ee2662a229fa
DIFF: https://github.com/llvm/llvm-project/commit/7f3dcf4b2e1001c829ec431996d4ee2662a229fa.diff

LOG: [ctx_prof] Don't use `GENERATE_DRIVER` (#100777)

Added: 
    

Modified: 
    llvm/tools/llvm-ctxprof-util/CMakeLists.txt
    llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-ctxprof-util/CMakeLists.txt b/llvm/tools/llvm-ctxprof-util/CMakeLists.txt
index abf8e1aa0651f..4814c9941da5a 100644
--- a/llvm/tools/llvm-ctxprof-util/CMakeLists.txt
+++ b/llvm/tools/llvm-ctxprof-util/CMakeLists.txt
@@ -10,5 +10,4 @@ llvm-ctxprof-util.cpp
 
   DEPENDS
   intrinsics_gen
-  GENERATE_DRIVER
   )

diff  --git a/llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp b/llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp
index ded8c8a6e4332..3bb7681e33a87 100644
--- a/llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp
+++ b/llvm/tools/llvm-ctxprof-util/llvm-ctxprof-util.cpp
@@ -19,8 +19,8 @@
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/InitLLVM.h"
 #include "llvm/Support/JSON.h"
-#include "llvm/Support/LLVMDriver.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/raw_ostream.h"
 
@@ -132,7 +132,7 @@ Error convertFromJSON() {
   return Error::success();
 }
 
-int llvm_ctxprof_util_main(int argc, char **argv, const llvm::ToolContext &) {
+int main(int argc, const char **argv) {
   cl::ParseCommandLineOptions(argc, argv, "LLVM Contextual Profile Utils\n");
   ExitOnError ExitOnErr("llvm-ctxprof-util: ");
   if (FromJSON) {
@@ -145,6 +145,6 @@ int llvm_ctxprof_util_main(int argc, char **argv, const llvm::ToolContext &) {
     }
     return 0;
   }
-  llvm_unreachable("Unknown subcommands should have been handled by the "
-                   "command line parser.");
+  cl::PrintHelpMessage();
+  return 1;
 }


        


More information about the llvm-commits mailing list