Add an ability to choose between different edges based on edge properties.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50732 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvmc2/CompilationGraph.h b/tools/llvmc2/CompilationGraph.h
index d953aee..18c1e6b 100644
--- a/tools/llvmc2/CompilationGraph.h
+++ b/tools/llvmc2/CompilationGraph.h
@@ -45,7 +45,7 @@
class SimpleEdge : public Edge {
public:
SimpleEdge(const std::string& T) : Edge(T) {}
- bool isEnabled() const { return true;}
+ bool isEnabled() const { return false;}
bool isDefault() const { return true;}
};
@@ -60,12 +60,16 @@
Node(CompilationGraph* G, Tool* T) : OwningGraph(G), ToolPtr(T) {}
bool HasChildren() const { return !OutEdges.empty(); }
+ const std::string Name() const { return ToolPtr->Name(); }
iterator EdgesBegin() { return OutEdges.begin(); }
const_iterator EdgesBegin() const { return OutEdges.begin(); }
iterator EdgesEnd() { return OutEdges.end(); }
const_iterator EdgesEnd() const { return OutEdges.end(); }
+ // Choose one of the edges based on command-line options.
+ const Edge* ChooseEdge() const;
+
// Takes ownership of the object.
void AddEdge(Edge* E)
{ OutEdges.push_back(llvm::IntrusiveRefCntPtr<Edge>(E)); }