aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-03-27 00:14:35 +0000
committerChad Rosier <mcrosier@apple.com>2013-03-27 00:14:35 +0000
commita03fc6e249e1662f879467f66c49a3c866850773 (patch)
tree978827e783933d6172e4a642cdbe3489380856cf /lib/CodeGen/BackendUtil.cpp
parent5035c483b7fcbf0fa2a7afba24fa35a10995d195 (diff)
If we're unable to create the TargetMachine, then just quit producing the
backend output; there's no need to report a fatal error. This reverts r178042. Part of rdar://13295753 and rdar://13401547 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 1d7395915b..019570ce23 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -329,7 +329,7 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
const llvm::Target *TheTarget = TargetRegistry::lookupTarget(Triple, Error);
if (!TheTarget) {
if (MustCreateTM)
- llvm::report_fatal_error ("Unable to create target: " + Error);
+ Diags.Report(diag::err_fe_unable_to_create_target) << Error;
return 0;
}
@@ -527,6 +527,7 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action, raw_ostream *OS) {
Action != Backend_EmitBC &&
Action != Backend_EmitLL);
TargetMachine *TM = CreateTargetMachine(UsesCodeGen);
+ if (UsesCodeGen && !TM) return;
CreatePasses(TM);
switch (Action) {