File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,6 @@ static bool shouldForceLegacyPM() {
392
392
//
393
393
int main (int argc, char **argv) {
394
394
InitLLVM X (argc, argv);
395
- ExitOnError ExitOnErr (std::string (argv[0 ]) + " : error: " );
396
395
397
396
// Enable debug stream buffering.
398
397
EnableDebugBuffering = true ;
@@ -598,8 +597,15 @@ int main(int argc, char **argv) {
598
597
if (ModuleTriple.getArch ()) {
599
598
CPUStr = codegen::getCPUStr ();
600
599
FeaturesStr = codegen::getFeaturesStr ();
601
- TM = ExitOnErr (codegen::createTargetMachineForTriple (ModuleTriple.str (),
602
- GetCodeGenOptLevel ()));
600
+ Expected<std::unique_ptr<TargetMachine>> ExpectedTM =
601
+ codegen::createTargetMachineForTriple (ModuleTriple.str (),
602
+ GetCodeGenOptLevel ());
603
+ if (auto E = ExpectedTM.takeError ()) {
604
+ errs () << argv[0 ] << " : WARNING: failed to create target machine for '"
605
+ << ModuleTriple.str () << " ': " << toString (std::move (E)) << " \n " ;
606
+ } else {
607
+ TM = std::move (*ExpectedTM);
608
+ }
603
609
} else if (ModuleTriple.getArchName () != " unknown" &&
604
610
ModuleTriple.getArchName () != " " ) {
605
611
errs () << argv[0 ] << " : unrecognized architecture '"
You can’t perform that action at this time.
0 commit comments