Fix a crasher by reporting a fatal error if we're unable to create the target
machine and one is required.
Part of rdar://13295753
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178042 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/DiagnosticFrontendKinds.td b/include/clang/Basic/DiagnosticFrontendKinds.td
index 111622e..2982268 100644
--- a/include/clang/Basic/DiagnosticFrontendKinds.td
+++ b/include/clang/Basic/DiagnosticFrontendKinds.td
@@ -42,8 +42,6 @@
"unable to load PCH file">;
def err_fe_unable_to_load_plugin : Error<
"unable to load plugin '%0': '%1'">;
-def err_fe_unable_to_create_target : Error<
- "unable to create target: '%0'">;
def err_fe_unable_to_interface_with_target : Error<
"unable to interface with target machine">;
def err_fe_unable_to_open_output : Error<
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 952d1fb..1d73959 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -329,7 +329,7 @@
const llvm::Target *TheTarget = TargetRegistry::lookupTarget(Triple, Error);
if (!TheTarget) {
if (MustCreateTM)
- Diags.Report(diag::err_fe_unable_to_create_target) << Error;
+ llvm::report_fatal_error ("Unable to create target: " + Error);
return 0;
}