This tool only parsed options after creating the LLVMContext.
Unfortunately, this means that some options, such as --opaque-pointers,
which are read when the LLVMContext is created are impossible to
set from the command line. This patch moves the LLVMContext creation
after the option parsing.
InitLLVM X(argc, argv);
ExitOnErr.setBanner(std::string(argv[0]) + ": ");
+ cl::HideUnrelatedOptions({&LinkCategory, &getColorCategory()});
+ cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
+
LLVMContext Context;
Context.setDiagnosticHandler(std::make_unique<LLVMLinkDiagnosticHandler>(),
true);
- cl::HideUnrelatedOptions({&LinkCategory, &getColorCategory()});
- cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
if (!DisableDITypeMap)
Context.enableDebugTypeODRUniquing();