diff --git a/src/V3Graph.cpp b/src/V3Graph.cpp index dda271082..8a57523c3 100644 --- a/src/V3Graph.cpp +++ b/src/V3Graph.cpp @@ -274,18 +274,18 @@ void V3Graph::dumpEdge(ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep) } } -void V3Graph::dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph) { +void V3Graph::dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph) const { if (v3Global.opt.dumpTree()) { dumpDotFile(v3Global.debugFilename(nameComment)+".dot", colorAsSubgraph); } } //! Variant of dumpDotFilePrefixed without --dump option check -void V3Graph::dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph) { +void V3Graph::dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph) const { dumpDotFile(v3Global.debugFilename(nameComment)+".dot", colorAsSubgraph); } -void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) { +void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const { // This generates a file used by graphviz, http://www.graphviz.org // "hardcoded" parameters: const vl_unique_ptr logp (V3File::new_ofstream(filename)); diff --git a/src/V3Graph.h b/src/V3Graph.h index 221f8a428..b546f2d8e 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -65,7 +65,7 @@ public: V3Graph(); virtual ~V3Graph(); static void debug(int level) { s_debug = level; } - virtual string dotRankDir() { return "TB"; } // rankdir for dot plotting + virtual string dotRankDir() const { return "TB"; } // rankdir for dot plotting // METHODS void clear(); // Empty it of all vertices/edges, as if making a new object @@ -127,9 +127,9 @@ public: /// Debugging void dump(ostream& os=cout); - void dumpDotFile(const string& filename, bool colorAsSubgraph); - void dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph=false); - void dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph=false); + void dumpDotFile(const string& filename, bool colorAsSubgraph) const; + void dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph=false) const; + void dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph=false) const; void userClearVertices(); void userClearEdges(); static void test();