Move enabling the local stack allocation pass into the target where it belongs.

For now it's still a command line option, but the interface to the generic
code doesn't need to know that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111942 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach
2010-08-24 19:05:43 +00:00
parent 05ea54e886
commit a273442891
6 changed files with 26 additions and 23 deletions
+4 -2
View File
@@ -74,10 +74,12 @@ FunctionPass *llvm::createLocalStackSlotAllocationPass() {
bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) {
MachineFrameInfo *MFI = MF.getFrameInfo();
const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo();
unsigned LocalObjectCount = MFI->getObjectIndexEnd();
// Early exit if there are no locals to consider
if (!LocalObjectCount)
// If the target doesn't want/need this pass, or if there are no locals
// to consider, early exit.
if (!TRI->requiresVirtualBaseRegisters(MF) || LocalObjectCount == 0)
return true;
// Make sure we have enough space to store the local offsets.