diff options
author | Chris Lattner <sabre@nondot.org> | 2002-02-12 22:39:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-02-12 22:39:50 +0000 |
commit | 455889aa79e3463a4b0f2161e3d9d72a683268b6 (patch) | |
tree | af1cb8e20b69e33a7a744365fb6e15445abf81ed /lib/Target | |
parent | cc179d3ab85fd19c3fd9586409c69d14fbb6c642 (diff) | |
download | external_llvm-455889aa79e3463a4b0f2161e3d9d72a683268b6.zip external_llvm-455889aa79e3463a4b0f2161e3d9d72a683268b6.tar.gz external_llvm-455889aa79e3463a4b0f2161e3d9d72a683268b6.tar.bz2 |
* Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
InstrTypes.h anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/SparcV9/InstrSched/InstrScheduling.cpp | 6 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSched/SchedGraph.h | 20 | ||||
-rw-r--r-- | lib/Target/SparcV9/InstrSelection/InstrSelection.cpp | 2 | ||||
-rw-r--r-- | lib/Target/SparcV9/LiveVar/BBLiveVar.cpp | 5 | ||||
-rw-r--r-- | lib/Target/SparcV9/SparcV9TargetMachine.cpp | 8 |
5 files changed, 21 insertions, 20 deletions
diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp index 6e6d14c..edf84d4 100644 --- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp +++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp @@ -17,6 +17,7 @@ #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" // FIXME: Remove when AnalysisUsage sets can be symbolic! #include "llvm/Target/TargetMachine.h" #include "llvm/BasicBlock.h" +#include "llvm/Instruction.h" #include "SchedPriorities.h" #include <ext/hash_set> #include <algorithm> @@ -1287,14 +1288,11 @@ ChooseInstructionsForDelaySlots(SchedulingManager& S, SchedGraph *graph) { const MachineInstrInfo& mii = S.getInstrInfo(); - const TerminatorInst *termInstr = bb->getTerminator(); + const Instruction *termInstr = (Instruction*)bb->getTerminator(); MachineCodeForInstruction &termMvec=MachineCodeForInstruction::get(termInstr); vector<SchedGraphNode*> delayNodeVec; const MachineInstr* brInstr = NULL; - assert(termInstr->getOpcode() != Instruction::Call - && "Call used as terminator?"); - if (termInstr->getOpcode() != Instruction::Ret) { // To find instructions that need delay slots without searching the full diff --git a/lib/Target/SparcV9/InstrSched/SchedGraph.h b/lib/Target/SparcV9/InstrSched/SchedGraph.h index 80355e4..fb6087c 100644 --- a/lib/Target/SparcV9/InstrSched/SchedGraph.h +++ b/lib/Target/SparcV9/InstrSched/SchedGraph.h @@ -391,13 +391,13 @@ private: // for <const SchedGraphNode, SchedGraphNode::const_iterator>. // template <class _NodeType, class _EdgeType, class _EdgeIter> -class PredIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> { +class SGPredIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> { protected: _EdgeIter oi; public: - typedef PredIterator<_NodeType, _EdgeType, _EdgeIter> _Self; + typedef SGPredIterator<_NodeType, _EdgeType, _EdgeIter> _Self; - inline PredIterator(_EdgeIter startEdge) : oi(startEdge) {} + inline SGPredIterator(_EdgeIter startEdge) : oi(startEdge) {} inline bool operator==(const _Self& x) const { return oi == x.oi; } inline bool operator!=(const _Self& x) const { return !operator==(x); } @@ -420,13 +420,13 @@ public: }; template <class _NodeType, class _EdgeType, class _EdgeIter> -class SuccIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> { +class SGSuccIterator: public std::bidirectional_iterator<_NodeType, ptrdiff_t> { protected: _EdgeIter oi; public: - typedef SuccIterator<_NodeType, _EdgeType, _EdgeIter> _Self; + typedef SGSuccIterator<_NodeType, _EdgeType, _EdgeIter> _Self; - inline SuccIterator(_EdgeIter startEdge) : oi(startEdge) {} + inline SGSuccIterator(_EdgeIter startEdge) : oi(startEdge) {} inline bool operator==(const _Self& x) const { return oi == x.oi; } inline bool operator!=(const _Self& x) const { return !operator==(x); } @@ -451,9 +451,9 @@ public: // sg_pred_iterator // sg_pred_const_iterator // -typedef PredIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator> +typedef SGPredIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator> sg_pred_iterator; -typedef PredIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator> +typedef SGPredIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator> sg_pred_const_iterator; inline sg_pred_iterator pred_begin( SchedGraphNode *N) { @@ -474,9 +474,9 @@ inline sg_pred_const_iterator pred_end( const SchedGraphNode *N) { // sg_succ_iterator // sg_succ_const_iterator // -typedef SuccIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator> +typedef SGSuccIterator<SchedGraphNode, SchedGraphEdge, SchedGraphNode::iterator> sg_succ_iterator; -typedef SuccIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator> +typedef SGSuccIterator<const SchedGraphNode, const SchedGraphEdge,SchedGraphNode::const_iterator> sg_succ_const_iterator; inline sg_succ_iterator succ_begin( SchedGraphNode *N) { diff --git a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp index cd0ca66..af02e57 100644 --- a/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp +++ b/lib/Target/SparcV9/InstrSelection/InstrSelection.cpp @@ -159,7 +159,7 @@ SelectInstructionsForMethod(Method* method, TargetMachine &target) void InsertPhiElimInst(BasicBlock *BB, MachineInstr *CpMI) { - TerminatorInst *TermInst = BB->getTerminator(); + Instruction *TermInst = (Instruction*)BB->getTerminator(); MachineCodeForInstruction &MC4Term = MachineCodeForInstruction::get(TermInst); MachineInstr *FirstMIOfTerm = *( MC4Term.begin() ); diff --git a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp index 84adecd..1468301 100644 --- a/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp +++ b/lib/Target/SparcV9/LiveVar/BBLiveVar.cpp @@ -8,6 +8,7 @@ #include "llvm/Analysis/LiveVar/MethodLiveVarInfo.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/BasicBlock.h" +#include "llvm/Support/CFG.h" #include "Support/SetOperations.h" /// BROKEN: Should not include sparc stuff directly into here @@ -197,8 +198,8 @@ bool BBLiveVar::applyFlowFunc() { // bool needAnotherIt = false; - for (BasicBlock::pred_const_iterator PI = BB->pred_begin(), - PE = BB->pred_begin(); PI != PE ; ++PI) { + for (pred_const_iterator PI = pred_begin(BB), PE = pred_begin(BB); + PI != PE ; ++PI) { BBLiveVar *PredLVBB = BBLiveVar::GetFromBB(*PI); // do set union diff --git a/lib/Target/SparcV9/SparcV9TargetMachine.cpp b/lib/Target/SparcV9/SparcV9TargetMachine.cpp index b026ccd..a4556d1 100644 --- a/lib/Target/SparcV9/SparcV9TargetMachine.cpp +++ b/lib/Target/SparcV9/SparcV9TargetMachine.cpp @@ -84,15 +84,16 @@ void InsertPrologEpilogCode::InsertPrologCode(Method* method) void InsertPrologEpilogCode::InsertEpilogCode(Method* method) { - for (Method::iterator I=method->begin(), E=method->end(); I != E; ++I) - if ((*I)->getTerminator()->getOpcode() == Instruction::Ret) + for (Method::iterator I=method->begin(), E=method->end(); I != E; ++I) { + Instruction *TermInst = (Instruction*)(*I)->getTerminator(); + if (TermInst->getOpcode() == Instruction::Ret) { BasicBlock* exitBB = *I; unsigned N = GetInstructionsForEpilog(exitBB, Target, minstrVec); MachineCodeForBasicBlock& bbMvec = exitBB->getMachineInstrVec(); MachineCodeForInstruction &termMvec = - MachineCodeForInstruction::get(exitBB->getTerminator()); + MachineCodeForInstruction::get(TermInst); // Remove the NOPs in the delay slots of the return instruction const MachineInstrInfo &mii = Target.getInstrInfo(); @@ -115,6 +116,7 @@ void InsertPrologEpilogCode::InsertEpilogCode(Method* method) // Append the epilog code to the end of the basic block. bbMvec.push_back(minstrVec[0]); } + } } |