aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llc
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-29 21:12:46 +0000
committerChris Lattner <sabre@nondot.org>2002-10-29 21:12:46 +0000
commit6334205cb5c626d2b35e42dd4c710b857bf0a126 (patch)
tree0330b254c66da59d0f34ff8c686a93053c66d3f1 /tools/llc
parent083ee69349df5bc6fc26da25acf0ba8628789589 (diff)
downloadexternal_llvm-6334205cb5c626d2b35e42dd4c710b857bf0a126.zip
external_llvm-6334205cb5c626d2b35e42dd4c710b857bf0a126.tar.gz
external_llvm-6334205cb5c626d2b35e42dd4c710b857bf0a126.tar.bz2
Allow TargetMachine to refuse static code gen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4415 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llc')
-rw-r--r--tools/llc/llc.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 8fb3124..9a30854 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -281,10 +281,14 @@ main(int argc, char **argv)
}
}
- Target.addPassesToEmitAssembly(Passes, *Out);
-
- // Run our queue of passes all at once now, efficiently.
- Passes.run(*M.get());
+ // Ask the target to add backend passes as neccesary
+ if (Target.addPassesToEmitAssembly(Passes, *Out)) {
+ cerr << argv[0] << ": target '" << Target.TargetName
+ << " does not support static compilation!\n";
+ } else {
+ // Run our queue of passes all at once now, efficiently.
+ Passes.run(*M.get());
+ }
// Delete the ostream if it's not a stdout stream
if (Out != &std::cout) delete Out;