From 414d9d270754a2bb4b5875e8c85078047ebfbea5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 5 Nov 2003 06:25:06 +0000 Subject: [PATCH] Do not use a class before it is defined. Be gcc 3.4 clean git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9727 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InstrSched/InstrScheduling.cpp | 15 +++++++++------ lib/Target/SparcV9/InstrSched/InstrScheduling.cpp | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/CodeGen/InstrSched/InstrScheduling.cpp b/lib/CodeGen/InstrSched/InstrScheduling.cpp index 2a2ef27a29f..a50439de7f6 100644 --- a/lib/CodeGen/InstrSched/InstrScheduling.cpp +++ b/lib/CodeGen/InstrSched/InstrScheduling.cpp @@ -111,10 +111,7 @@ public: inline bool operator!=(const _Self& x) const { return !operator==(x); } - inline _NodeType* operator*() const { - assert(cycleNum < S.groups.size()); - return (*S.groups[cycleNum])[slotNum]; - } + inline _NodeType* operator*() const; inline _NodeType* operator->() const { return operator*(); } _Self& operator++(); // Preincrement @@ -201,11 +198,17 @@ public: // accessor functions to query chosen schedule } private: - friend class iterator; - friend class const_iterator; + friend class ScheduleIterator; + friend class ScheduleIterator; /*ctor*/ InstrSchedule (); // Disable: DO NOT IMPLEMENT. }; +template +inline NodeType *ScheduleIterator::operator*() const { + assert(cycleNum < S.groups.size()); + return (*S.groups[cycleNum])[slotNum]; +} + /*ctor*/ InstrSchedule::InstrSchedule(unsigned int _nslots, unsigned int _numNodes) diff --git a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp index 2a2ef27a29f..a50439de7f6 100644 --- a/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp +++ b/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp @@ -111,10 +111,7 @@ public: inline bool operator!=(const _Self& x) const { return !operator==(x); } - inline _NodeType* operator*() const { - assert(cycleNum < S.groups.size()); - return (*S.groups[cycleNum])[slotNum]; - } + inline _NodeType* operator*() const; inline _NodeType* operator->() const { return operator*(); } _Self& operator++(); // Preincrement @@ -201,11 +198,17 @@ public: // accessor functions to query chosen schedule } private: - friend class iterator; - friend class const_iterator; + friend class ScheduleIterator; + friend class ScheduleIterator; /*ctor*/ InstrSchedule (); // Disable: DO NOT IMPLEMENT. }; +template +inline NodeType *ScheduleIterator::operator*() const { + assert(cycleNum < S.groups.size()); + return (*S.groups[cycleNum])[slotNum]; +} + /*ctor*/ InstrSchedule::InstrSchedule(unsigned int _nslots, unsigned int _numNodes) -- 2.34.1