[llc] Initialize context for parsing options

This will allow using -force-opaque-pointers in codegen tests.
This commit is contained in:
Nikita Popov 2021-08-28 22:36:37 +02:00
parent 29df4ab3f3
commit ae5e5f2011
1 changed files with 1 additions and 2 deletions

View File

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