[llc] Initialize context for parsing options
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 28 Aug 2021 20:36:37 +0000 (22:36 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 28 Aug 2021 20:37:26 +0000 (22:37 +0200)
This will allow using -force-opaque-pointers in codegen tests.

llvm/tools/llc/llc.cpp

index 58f19b2..dd90e82 100644 (file)
@@ -329,8 +329,6 @@ int main(int argc, char **argv) {
   // Enable debug stream buffering.
   EnableDebugBuffering = true;
 
-  LLVMContext Context;
-
   // Initialize targets first, so that --version shows registered targets.
   InitializeAllTargets();
   InitializeAllTargetMCs();
@@ -365,6 +363,7 @@ int main(int argc, char **argv) {
 
   cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
 
+  LLVMContext Context;
   Context.setDiscardValueNames(DiscardValueNames);
 
   // Set a diagnostic handler that doesn't exit on the first error