@@ -111,17 +111,18 @@ INITIALIZE_PASS_END(IRTranslator, DEBUG_TYPE, "IRTranslator LLVM IR -> MI",
111111 false , false )
112112
113113static void reportTranslationError(MachineFunction &MF,
114- const TargetPassConfig &TPC,
115114 OptimizationRemarkEmitter &ORE,
116115 OptimizationRemarkMissed &R) {
117116 MF.getProperties ().setFailedISel ();
117+ bool IsGlobalISelAbortEnabled =
118+ MF.getTarget ().Options .GlobalISelAbort == GlobalISelAbortMode::Enable;
118119
119120 // Print the function name explicitly if we don't have a debug location (which
120121 // makes the diagnostic less useful) or if we're going to emit a raw error.
121- if (!R.getLocation ().isValid () || TPC. isGlobalISelAbortEnabled () )
122+ if (!R.getLocation ().isValid () || IsGlobalISelAbortEnabled )
122123 R << (" (in function: " + MF.getName () + " )" ).str ();
123124
124- if (TPC. isGlobalISelAbortEnabled () )
125+ if (IsGlobalISelAbortEnabled )
125126 report_fatal_error (Twine (R.getMsg ()));
126127 else
127128 ORE.emit (R);
@@ -242,7 +243,7 @@ ArrayRef<Register> IRTranslator::getOrCreateVRegs(const Value &Val) {
242243 MF->getFunction ().getSubprogram (),
243244 &MF->getFunction ().getEntryBlock ());
244245 R << " unable to translate constant: " << ore::NV (" Type" , Val.getType ());
245- reportTranslationError (*MF, *TPC, * ORE, R);
246+ reportTranslationError (*MF, *ORE, R);
246247 return *VRegs;
247248 }
248249 }
@@ -279,7 +280,7 @@ Align IRTranslator::getMemOpAlign(const Instruction &I) {
279280
280281 OptimizationRemarkMissed R (" gisel-irtranslator" , " " , &I);
281282 R << " unable to translate memop: " << ore::NV (" Opcode" , &I);
282- reportTranslationError (*MF, *TPC, * ORE, R);
283+ reportTranslationError (*MF, *ORE, R);
283284 return Align (1 );
284285}
285286
@@ -4147,7 +4148,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
41474148 OptimizationRemarkMissed R (" gisel-irtranslator" , " GISelFailure" ,
41484149 F.getSubprogram (), &F.getEntryBlock ());
41494150 R << " unable to translate in big endian mode" ;
4150- reportTranslationError (*MF, *TPC, * ORE, R);
4151+ reportTranslationError (*MF, *ORE, R);
41514152 return false ;
41524153 }
41534154
@@ -4191,7 +4192,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
41914192 F.getSubprogram (), &F.getEntryBlock ());
41924193 R << " unable to lower function: "
41934194 << ore::NV (" Prototype" , F.getFunctionType ());
4194- reportTranslationError (*MF, *TPC, * ORE, R);
4195+ reportTranslationError (*MF, *ORE, R);
41954196 return false ;
41964197 }
41974198
@@ -4214,7 +4215,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
42144215 F.getSubprogram (), &F.getEntryBlock ());
42154216 R << " unable to lower arguments: "
42164217 << ore::NV (" Prototype" , F.getFunctionType ());
4217- reportTranslationError (*MF, *TPC, * ORE, R);
4218+ reportTranslationError (*MF, *ORE, R);
42184219 return false ;
42194220 }
42204221
@@ -4265,15 +4266,15 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
42654266 R << " : '" << InstStrStorage << " '" ;
42664267 }
42674268
4268- reportTranslationError (*MF, *TPC, * ORE, R);
4269+ reportTranslationError (*MF, *ORE, R);
42694270 return false ;
42704271 }
42714272
42724273 if (!finalizeBasicBlock (*BB, MBB)) {
42734274 OptimizationRemarkMissed R (" gisel-irtranslator" , " GISelFailure" ,
42744275 BB->getTerminator ()->getDebugLoc (), BB);
42754276 R << " unable to translate basic block" ;
4276- reportTranslationError (*MF, *TPC, * ORE, R);
4277+ reportTranslationError (*MF, *ORE, R);
42774278 return false ;
42784279 }
42794280 }
0 commit comments