[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
This commit is contained in:
Francis Visoiu Mistrih 2018-02-05 22:46:54 +00:00
parent cf9dda307c
commit 9d8994460a

View File

@ -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