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
This commit is contained in:
Chad Rosier 2013-03-27 00:14:35 +00:00
Родитель 5035c483b7
Коммит a03fc6e249
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -42,6 +42,8 @@ def err_fe_unable_to_load_pch : Error<
"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<

Просмотреть файл

@ -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) {