File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
319319 case MCCFIInstruction::OpValOffset:
320320 break ;
321321 }
322- assert ((bool ) CSRReg + ( bool )CSROffset <= 1 &&
322+ assert ((! CSRReg. has_value () || !CSROffset. has_value ()) &&
323323 " A register can only be at an offset from CFA or in another "
324324 " register, but not both!" );
325325 CSRSavedLocation CSRLoc;
@@ -328,13 +328,10 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
328328 else if (CSROffset)
329329 CSRLoc = CSRSavedLocation::createCFAOffset (*CSROffset);
330330 if (CSRLoc.isValid ()) {
331- auto It = CSRLocMap.find (CFI.getRegister ());
332- if (It == CSRLocMap.end ()) {
333- CSRLocMap.insert ({CFI.getRegister (), CSRLoc});
334- } else if (It->second != CSRLoc) {
331+ auto [It, Inserted] = CSRLocMap.insert ({CFI.getRegister (), CSRLoc});
332+ if (!Inserted && It->second != CSRLoc)
335333 reportFatalInternalError (
336334 " Different saved locations for the same CSR" );
337- }
338335 CSRSaved.set (CFI.getRegister ());
339336 }
340337 }
You can’t perform that action at this time.
0 commit comments