ARM/AArch64: Attach the FrameSetup MIFlag to CFI instructions.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.cpp
index b7e9d656e901e96577ede25311c7db0e0d888889..5413c9b5aff8f82910a74dca4123d2ee56bcccee 100644 (file)
@@ -1117,8 +1117,12 @@ static DebugLoc findPrologueEndLoc(const MachineFunction *MF) {
   for (const auto &MBB : *MF)
     for (const auto &MI : MBB)
       if (!MI.isDebugValue() && !MI.getFlag(MachineInstr::FrameSetup) &&
-          !MI.getDebugLoc().isUnknown())
+        !MI.getDebugLoc().isUnknown()) {
+        // Did the target forget to set the FrameSetup flag for CFI insns?
+        assert(!MI.isCFIInstruction() &&
+               "First non-frame-setup instruction is a CFI instruction.");
         return MI.getDebugLoc();
+      }
   return DebugLoc();
 }