llvm.org GIT mirror llvm / 2d7581a
Use ilist rather than std::list for Node and Edge lists in the PBQP graph. This should fix an issue (described at http://stackoverflow.com/questions/10065384/instantiation-of-a-list-with-an-incomplete-type-in-a-typedef) that was preventing LLVMCodeGen from building with libc++ in C++11 mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166484 91177308-0d34-0410-b5e6-96231b3b80d8 Lang Hames 7 years ago
1 changed file(s) with 14 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
1818
1919 #include
2020 #include
21 #include
2122
2223 namespace PBQP {
2324
3031 class NodeEntry;
3132 class EdgeEntry;
3233
33 typedef std::list NodeList;
34 typedef std::list EdgeList;
34 typedef llvm::ilist NodeList;
35 typedef llvm::ilist EdgeList;
3536
3637 public:
3738
38 typedef NodeList::iterator NodeItr;
39 typedef NodeList::const_iterator ConstNodeItr;
40
41 typedef EdgeList::iterator EdgeItr;
42 typedef EdgeList::const_iterator ConstEdgeItr;
39 typedef NodeEntry* NodeItr;
40 typedef const NodeEntry* ConstNodeItr;
41
42 typedef EdgeEntry* EdgeItr;
43 typedef const EdgeEntry* ConstEdgeItr;
4344
4445 private:
4546
5152
5253 private:
5354
54 class NodeEntry {
55 class NodeEntry : public llvm::ilist_node {
56 friend struct llvm::ilist_sentinel_traits;
5557 private:
5658 Vector costs;
5759 AdjEdgeList adjEdges;
5860 unsigned degree;
5961 void *data;
62 NodeEntry() : costs(0, 0) {}
6063 public:
6164 NodeEntry(const Vector &costs) : costs(costs), degree(0) {}
6265 Vector& getCosts() { return costs; }
7679 void* getData() { return data; }
7780 };
7881
79 class EdgeEntry {
82 class EdgeEntry : public llvm::ilist_node {
83 friend struct llvm::ilist_sentinel_traits;
8084 private:
8185 NodeItr node1, node2;
8286 Matrix costs;
8387 AdjEdgeItr node1AEItr, node2AEItr;
8488 void *data;
89 EdgeEntry() : costs(0, 0, 0) {}
8590 public:
8691 EdgeEntry(NodeItr node1, NodeItr node2, const Matrix &costs)
8792 : node1(node1), node2(node2), costs(costs) {}