path: root/tools/llc
diff options
authorEric Christopher <>2014-05-06 16:29:50 +0000
committerEric Christopher <>2014-05-06 16:29:50 +0000
commitbfc3f301b6a5390b990c4abb05d134ffe8bb59bb (patch)
treeb46d4349e51703bc2bbb7cbe6565be1c21af9dfb /tools/llc
parent534ec26d07646092bc869e76e61e95dca3915e1b (diff)
Have the SubtargetFeature help routine just not return a number and
fall back to the normal path without a cpu. While doing this fix llc to just exit when we don't have a module to process instead of asserting. git-svn-id: 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 654a9c3eeea..712817d9347 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -277,7 +277,14 @@ static int compileModule(char **argv, LLVMContext &Context) {
TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr,
Options, RelocModel, CMModel, OLvl));
assert(target.get() && "Could not allocate target machine!");
- assert(mod && "Should have exited after outputting help!");
+ // If we don't have a module then just exit now. We do this down
+ // here since the CPU/Feature help is underneath the target machine
+ // creation.
+ if (SkipModule)
+ return 0;
+ assert(mod && "Should have exited if we didn't have a module!");
TargetMachine &Target = *target.get();
if (EnableDwarfDirectory)