Skip to content

Commit 5c300d5

Browse files
committed
[llvm-cgdata] Remove GENERATE_DRIVER option
This tool shouldn't be used in the driver build until it is converted to use `OptTable` for option parsing, otherwise the `cl::opt` options might conflict with options in other tools resulting in link failures. This is a reland of #100066.
1 parent 7d0a584 commit 5c300d5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

llvm/tools/llvm-cgdata/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ add_llvm_tool(llvm-cgdata
1111

1212
DEPENDS
1313
intrinsics_gen
14-
GENERATE_DRIVER
1514
)

llvm/tools/llvm-cgdata/llvm-cgdata.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "llvm/IR/LLVMContext.h"
1919
#include "llvm/Object/Archive.h"
2020
#include "llvm/Support/CommandLine.h"
21-
#include "llvm/Support/LLVMDriver.h"
21+
#include "llvm/Support/InitLLVM.h"
2222
#include "llvm/Support/Path.h"
2323
#include "llvm/Support/VirtualFileSystem.h"
2424
#include "llvm/Support/WithColor.h"
@@ -240,8 +240,8 @@ static int show_main(int argc, const char *argv[]) {
240240
return 0;
241241
}
242242

243-
int llvm_cgdata_main(int argc, char **argvNonConst, const llvm::ToolContext &) {
244-
const char **argv = const_cast<const char **>(argvNonConst);
243+
int main(int argc, const char **argv) {
244+
llvm::InitLLVM X(argc, argv);
245245

246246
StringRef ProgName(sys::path::filename(argv[0]));
247247

0 commit comments

Comments
 (0)