summaryrefslogtreecommitdiff
path: root/tools/llc/llc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llc/llc.cpp')
-rw-r--r--tools/llc/llc.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 654a9c3eee..712817d934 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)