[llvm] ae5e5f2 - [llc] Initialize context for parsing options

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 28 13:37:43 PDT 2021


Author: Nikita Popov
Date: 2021-08-28T22:37:26+02:00
New Revision: ae5e5f2011d583b9462a5747e22a0727a1b9b3bf

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

LOG: [llc] Initialize context for parsing options

This will allow using -force-opaque-pointers in codegen tests.

Added: 
    

Modified: 
    llvm/tools/llc/llc.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index 58f19b2c6d4b9..dd90e824ee104 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -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


        


More information about the llvm-commits mailing list