track local frame size in MFI, not local to the pass, since PEI needs it.
authorJim Grosbach <grosbach@apple.com>
Mon, 16 Aug 2010 18:06:15 +0000 (18:06 +0000)
committerJim Grosbach <grosbach@apple.com>
Mon, 16 Aug 2010 18:06:15 +0000 (18:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111164 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineFrameInfo.h
lib/CodeGen/LocalStackSlotAllocation.cpp

index 7c98b36e9aec708f4b019ecf45a40deeef951292..c99b5f59c1d5d616755063da3909e3e8d102b244 100644 (file)
@@ -296,6 +296,9 @@ public:
   /// blob.
   int64_t getLocalFrameBaseOffset() const { return LocalFrameBaseOffset; }
 
+  /// setLocalFrameSize - Set the size of the local object blob.
+  void setLocalFrameSize(int64_t sz) { LocalFrameSize = sz; }
+
   /// getLocalFrameSize - Get the size of the local object blob.
   int64_t getLocalFrameSize() const { return LocalFrameSize; }
 
index dabfb469c34f5d05c5d0db8c6347b8a3294dfc2b..8cacc179fa04a3083fecd7071837cadd5e0d4dac 100644 (file)
@@ -40,8 +40,6 @@ STATISTIC(NumAllocations, "Number of frame indices processed");
 
 namespace {
   class LocalStackSlotPass: public MachineFunctionPass {
-    int64_t LocalStackSize;
-
     void calculateFrameObjectOffsets(MachineFunction &Fn);
   public:
     static char ID; // Pass identification, replacement for typeid
@@ -68,7 +66,6 @@ FunctionPass *llvm::createLocalStackSlotAllocationPass() {
 
 bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) {
   calculateFrameObjectOffsets(MF);
-  DEBUG(dbgs() << LocalStackSize << " bytes of local storage pre-allocated\n");
   return true;
 }
 
@@ -165,5 +162,5 @@ void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) {
   }
 
   // Remember how big this blob of stack space is
-  LocalStackSize = Offset;
+  MFI->setLocalFrameSize(Offset);
 }