summaryrefslogtreecommitdiff
path: root/tools/llc
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-16 02:04:54 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-16 02:04:54 +0000
commit494d663175bbaa7db4743105d1efdf78be9cdb03 (patch)
tree7290794729190259d23db08f67dcd2dd1bf2ef6a /tools/llc
parent64cc97212346992892b6c92158c08cd93149a882 (diff)
Make sure targets are initialized before we do anything, even command line
processing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 34587173ab9..304638c52f7 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -210,10 +210,12 @@ int main(int argc, char **argv) {
PrettyStackTraceProgram X(argc, argv);
LLVMContext &Context = getGlobalContext();
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
- cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
+ // Initialize targets first.
InitializeAllTargets();
InitializeAllAsmPrinters();
+
+ cl::ParseCommandLineOptions(argc, argv, "llvm system compiler\n");
// Load the module to be compiled...
std::string ErrorMessage;