Support multiple ValueTypes per RegisterClass, needed for upcoming vector
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9FrameInfo.cpp
index 6727aac29af6ce74b777be546aba6c1b199296be..5e8fba621538d2b6d17e29d3a274beefb6e71693 100644 (file)
@@ -1,45 +1,39 @@
 //===-- SparcV9FrameInfo.cpp - Stack frame layout info for SparcV9 --------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
-// 
+//
 // Interface to stack frame layout info for the UltraSPARC.
-// 
+//
 //===----------------------------------------------------------------------===//
 
 #include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineFunctionInfo.h"
 #include "llvm/Target/TargetFrameInfo.h"
+#include "MachineFunctionInfo.h"
 #include "SparcV9FrameInfo.h"
 
 using namespace llvm;
 
 int
-SparcV9FrameInfo::getFirstAutomaticVarOffset(MachineFunction&, bool& pos) const {
-  pos = false;                          // static stack area grows downwards
-  return StaticAreaOffsetFromFP;
-}
-
-int
-SparcV9FrameInfo::getRegSpillAreaOffset(MachineFunction& mcInfo, bool& pos) const 
+SparcV9FrameInfo::getRegSpillAreaOffset(MachineFunction& mcInfo, bool& pos) const
 {
   // ensure no more auto vars are added
-  mcInfo.getInfo()->freezeAutomaticVarsArea();
-  
+  mcInfo.getInfo<SparcV9FunctionInfo>()->freezeAutomaticVarsArea();
+
   pos = false;                          // static stack area grows downwards
-  unsigned autoVarsSize = mcInfo.getInfo()->getAutomaticVarsSize();
-  return StaticAreaOffsetFromFP - autoVarsSize; 
+  unsigned autoVarsSize = mcInfo.getInfo<SparcV9FunctionInfo>()->getAutomaticVarsSize();
+  return StaticAreaOffsetFromFP - autoVarsSize;
 }
 
 int SparcV9FrameInfo::getTmpAreaOffset(MachineFunction& mcInfo, bool& pos) const {
-  MachineFunctionInfo *MFI = mcInfo.getInfo();
+  SparcV9FunctionInfo *MFI = mcInfo.getInfo<SparcV9FunctionInfo>();
   MFI->freezeAutomaticVarsArea();     // ensure no more auto vars are added
   MFI->freezeSpillsArea();            // ensure no more spill slots are added
-  
+
   pos = false;                          // static stack area grows downwards
   unsigned autoVarsSize = MFI->getAutomaticVarsSize();
   unsigned spillAreaSize = MFI->getRegSpillsSize();
@@ -54,7 +48,7 @@ SparcV9FrameInfo::getDynamicAreaOffset(MachineFunction& mcInfo, bool& pos) const
   // during calls and traps, so they are shifted downwards on each
   // dynamic-size alloca.
   pos = false;
-  unsigned optArgsSize = mcInfo.getInfo()->getMaxOptionalArgsSize();
+  unsigned optArgsSize = mcInfo.getInfo<SparcV9FunctionInfo>()->getMaxOptionalArgsSize();
   if (int extra = optArgsSize % 16)
     optArgsSize += (16 - extra);
   int offset = optArgsSize + FirstOptionalOutgoingArgOffsetFromSP;