mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 02:24:29 +00:00
Use deterministic iterator for SchedGraphs. This is actually not
useful right now when we only do local scheduling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1975 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -336,49 +336,35 @@ private:
|
|||||||
|
|
||||||
class SchedGraphSet :
|
class SchedGraphSet :
|
||||||
public NonCopyable,
|
public NonCopyable,
|
||||||
private std::hash_map<const BasicBlock*, SchedGraph*>
|
private std::vector<SchedGraph*>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const Function* method;
|
const Function* method;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::hash_map<const BasicBlock*, SchedGraph*> map_base;
|
typedef std::vector<SchedGraph*> baseVector;
|
||||||
using map_base::iterator;
|
using baseVector::iterator;
|
||||||
using map_base::const_iterator;
|
using baseVector::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*ctor*/ SchedGraphSet (const Function * function,
|
/*ctor*/ SchedGraphSet (const Function * function,
|
||||||
const TargetMachine& target);
|
const TargetMachine& target);
|
||||||
/*dtor*/ ~SchedGraphSet ();
|
/*dtor*/ ~SchedGraphSet ();
|
||||||
|
|
||||||
//
|
|
||||||
// Accessors
|
|
||||||
//
|
|
||||||
SchedGraph* getGraphForBasicBlock (const BasicBlock* bb) const {
|
|
||||||
const_iterator onePair = this->find(bb);
|
|
||||||
return (onePair != this->end())? (*onePair).second : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Iterators
|
// Iterators
|
||||||
//
|
using baseVector::begin;
|
||||||
using map_base::begin;
|
using baseVector::end;
|
||||||
using map_base::end;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Debugging support
|
// Debugging support
|
||||||
//
|
|
||||||
void dump () const;
|
void dump () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline void noteGraphForBlock(const BasicBlock* bb, SchedGraph* graph) {
|
inline void addGraph(SchedGraph* graph) {
|
||||||
assert((*this)[bb] == NULL);
|
assert(graph != NULL);
|
||||||
(*this)[bb] = graph;
|
this->push_back(graph);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Graph builder
|
// Graph builder
|
||||||
//
|
|
||||||
void buildGraphsForMethod (const Function *F,
|
void buildGraphsForMethod (const Function *F,
|
||||||
const TargetMachine& target);
|
const TargetMachine& target);
|
||||||
};
|
};
|
||||||
|
@ -336,49 +336,35 @@ private:
|
|||||||
|
|
||||||
class SchedGraphSet :
|
class SchedGraphSet :
|
||||||
public NonCopyable,
|
public NonCopyable,
|
||||||
private std::hash_map<const BasicBlock*, SchedGraph*>
|
private std::vector<SchedGraph*>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const Function* method;
|
const Function* method;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef std::hash_map<const BasicBlock*, SchedGraph*> map_base;
|
typedef std::vector<SchedGraph*> baseVector;
|
||||||
using map_base::iterator;
|
using baseVector::iterator;
|
||||||
using map_base::const_iterator;
|
using baseVector::const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/*ctor*/ SchedGraphSet (const Function * function,
|
/*ctor*/ SchedGraphSet (const Function * function,
|
||||||
const TargetMachine& target);
|
const TargetMachine& target);
|
||||||
/*dtor*/ ~SchedGraphSet ();
|
/*dtor*/ ~SchedGraphSet ();
|
||||||
|
|
||||||
//
|
|
||||||
// Accessors
|
|
||||||
//
|
|
||||||
SchedGraph* getGraphForBasicBlock (const BasicBlock* bb) const {
|
|
||||||
const_iterator onePair = this->find(bb);
|
|
||||||
return (onePair != this->end())? (*onePair).second : NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Iterators
|
// Iterators
|
||||||
//
|
using baseVector::begin;
|
||||||
using map_base::begin;
|
using baseVector::end;
|
||||||
using map_base::end;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Debugging support
|
// Debugging support
|
||||||
//
|
|
||||||
void dump () const;
|
void dump () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline void noteGraphForBlock(const BasicBlock* bb, SchedGraph* graph) {
|
inline void addGraph(SchedGraph* graph) {
|
||||||
assert((*this)[bb] == NULL);
|
assert(graph != NULL);
|
||||||
(*this)[bb] = graph;
|
this->push_back(graph);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Graph builder
|
// Graph builder
|
||||||
//
|
|
||||||
void buildGraphsForMethod (const Function *F,
|
void buildGraphsForMethod (const Function *F,
|
||||||
const TargetMachine& target);
|
const TargetMachine& target);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user