diff options
| author | Bill Wendling <isanbard@gmail.com> | 2010-05-14 21:14:32 +0000 |
|---|---|---|
| committer | Bill Wendling <isanbard@gmail.com> | 2010-05-14 21:14:32 +0000 |
| commit | 95f6ebcb37fe5d24f80752881509098c3fdf7b48 (patch) | |
| tree | 7dd01cc001e7edf2c28809c82416f1fd6ee360d8 /llvm/lib/CodeGen/SelectionDAG | |
| parent | c87e867111919591e0e7de34872eae5f13ff0459 (diff) | |
| download | bcm5719-llvm-95f6ebcb37fe5d24f80752881509098c3fdf7b48.tar.gz bcm5719-llvm-95f6ebcb37fe5d24f80752881509098c3fdf7b48.zip | |
Rename "HasCalls" in MachineFrameInfo to "AdjustsStack" to better describe what
the variable actually tracks.
N.B., several back-ends are using "HasCalls" as being synonymous for something
that adjusts the stack. This isn't 100% correct and should be looked into.
llvm-svn: 103802
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 422cb7aaafc..8c0a61f8518 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -28,6 +28,7 @@ #include "llvm/CodeGen/FastISel.h" #include "llvm/CodeGen/GCStrategy.h" #include "llvm/CodeGen/GCMetadata.h" +#include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineModuleInfo.h" @@ -605,6 +606,19 @@ MachineBasicBlock *SelectionDAGISel::CodeGenAndEmitDAG(MachineBasicBlock *BB) { delete Scheduler; } + // Determine if there are any calls in this machine function. + MachineFrameInfo *MFI = MF->getFrameInfo(); + if (!MFI->hasCalls()) { + for (MachineBasicBlock::iterator + I = BB->begin(), E = BB->end(); I != E; ++I) { + const TargetInstrDesc &TID = TM.getInstrInfo()->get(I->getOpcode()); + if (I->isInlineAsm() || (TID.isCall() && !TID.isReturn())) { + MFI->setHasCalls(true); + break; + } + } + } + // Free the SelectionDAG state, now that we're finished with it. CurDAG->clear(); |

