Bläddra i källkod

[PEI][NFC] Move StackSize opt-remark code next to -warn-stack code

This allows us to make sure we're always having the same sizes in both
remarks and warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324283 91177308-0d34-0410-b5e6-96231b3b80d8
Francis Visoiu Mistrih 7 år sedan
förälder
incheckning
9d8994460a
1 ändrade filer med 6 tillägg och 7 borttagningar
  1. 6 7
      lib/CodeGen/PrologEpilogInserter.cpp

+ 6 - 7
lib/CodeGen/PrologEpilogInserter.cpp

@@ -227,6 +227,12 @@ bool PEI::runOnMachineFunction(MachineFunction &Fn) {
     DiagnosticInfoStackSize DiagStackSize(F, StackSize);
     F.getContext().diagnose(DiagStackSize);
   }
+  ORE->emit([&]() {
+    return MachineOptimizationRemarkAnalysis(DEBUG_TYPE, "StackSize",
+                                             Fn.getFunction().getSubprogram(),
+                                             &Fn.front())
+           << ore::NV("NumStackBytes", StackSize) << " stack bytes in function";
+  });
 
   delete RS;
   SaveBlocks.clear();
@@ -949,13 +955,6 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   int64_t StackSize = Offset - LocalAreaOffset;
   MFI.setStackSize(StackSize);
   NumBytesStackSpace += StackSize;
-
-  ORE->emit([&]() {
-    return MachineOptimizationRemarkAnalysis(DEBUG_TYPE, "StackSize",
-                                             Fn.getFunction().getSubprogram(),
-                                             &Fn.front())
-           << ore::NV("NumStackBytes", StackSize) << " stack bytes in function";
-  });
 }
 
 /// insertPrologEpilogCode - Scan the function for modified callee saved