[llvm] [CFIInserter] Improve `CSRSavedLocation` struct. (PR #168869)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 09:49:19 PST 2025


================
@@ -266,12 +319,16 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
       case MCCFIInstruction::OpValOffset:
         break;
       }
-      if (CSRReg || CSROffset) {
+      CSRSavedLocation CSRLoc;
+      if (CSRReg)
+        CSRLoc = CSRSavedLocation::createRegister(*CSRReg);
+      if (CSROffset)
----------------
topperc wrote:

Should this be an `else if`? Maybe an assert that only one of CSRReg and CSROffset is non-zero?

https://github.com/llvm/llvm-project/pull/168869


More information about the llvm-commits mailing list