diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-07 07:27:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-07 07:27:27 +0000 |
commit | 749c6f6b5ed301c84aac562e414486549d7b98eb (patch) | |
tree | 275f34b73cd0673d5e8fdcfe02cdb6d60c5422c2 /lib/CodeGen/BranchFolding.cpp | |
parent | 682b8aed0779ac0c9a6a13d79ccc1cff3e9730cf (diff) |
rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BranchFolding.cpp')
-rw-r--r-- | lib/CodeGen/BranchFolding.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index 8ab4d4bdf9..0ca10b3cec 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -349,10 +349,10 @@ static unsigned EstimateRuntime(MachineBasicBlock::iterator I, MachineBasicBlock::iterator E) { unsigned Time = 0; for (; I != E; ++I) { - const TargetInstrDescriptor *TID = I->getDesc(); - if (TID->isCall()) + const TargetInstrDesc &TID = I->getDesc(); + if (TID.isCall()) Time += 10; - else if (TID->isSimpleLoad() || TID->mayStore()) + else if (TID.isSimpleLoad() || TID.mayStore()) Time += 2; else ++Time; @@ -778,7 +778,7 @@ static bool IsBetterFallthrough(MachineBasicBlock *MBB1, MachineInstr *MBB1I = --MBB1->end(); MachineInstr *MBB2I = --MBB2->end(); - return MBB2I->getDesc()->isCall() && !MBB1I->getDesc()->isCall(); + return MBB2I->getDesc().isCall() && !MBB1I->getDesc().isCall(); } /// OptimizeBlock - Analyze and optimize control flow related to the specified @@ -958,7 +958,7 @@ void BranchFolder::OptimizeBlock(MachineBasicBlock *MBB) { // If this branch is the only thing in its block, see if we can forward // other blocks across it. if (CurTBB && CurCond.empty() && CurFBB == 0 && - MBB->begin()->getDesc()->isBranch() && CurTBB != MBB) { + MBB->begin()->getDesc().isBranch() && CurTBB != MBB) { // This block may contain just an unconditional branch. Because there can // be 'non-branch terminators' in the block, try removing the branch and // then seeing if the block is empty. |