Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK...
[oota-llvm.git] / include / llvm / CompilerDriver / CompilationGraph.h
index b03f144f1bc19298df7773e13ff8a5f6c72c8777..825d4c40f8aaad4c5d668023f184c76e8f564b1a 100644 (file)
@@ -157,8 +157,8 @@ namespace llvmc {
     /// in your path.
     void viewGraph();
 
-    /// writeGraph - Write a compilation-graph.dot file.
-    void writeGraph();
+    /// writeGraph - Write Graphviz .dot source file to the current direcotry.
+    void writeGraph(const std::string& OutputFilename);
 
     // GraphTraits support.
     friend NodesIterator GraphBegin(CompilationGraph*);
@@ -261,16 +261,19 @@ namespace llvmc {
       return *this;
     }
 
-    inline bool operator==(const ThisType& I) const
-    { return EdgeIter == I.EdgeIter; }
-    inline bool operator!=(const ThisType& I) const
-    { return EdgeIter != I.EdgeIter; }
+    inline bool operator==(const ThisType& I) const {
+      assert(OwningGraph == I.OwningGraph);
+      return EdgeIter == I.EdgeIter;
+    }
+    inline bool operator!=(const ThisType& I) const {
+      return !this->operator==(I);
+    }
 
     inline pointer operator*() const {
       return &OwningGraph->getNode((*EdgeIter)->ToolName());
     }
     inline pointer operator->() const {
-      return &OwningGraph->getNode((*EdgeIter)->ToolName());
+      return this->operator*();
     }
 
     ThisType& operator++() { ++EdgeIter; return *this; } // Preincrement