From cfca06d7963fa0909f90483b42a6d7d194d01e08 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 26 Jul 2020 19:36:28 +0000 Subject: Vendor import of llvm-project master 2e10b7a39b9, the last commit before the llvmorg-12-init tag, from which release/11.x was branched. --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index cdc09d59f6a4..059a6baf967a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -70,7 +70,7 @@ namespace llvm { } static std::string getGraphName(const SelectionDAG *G) { - return G->getMachineFunction().getName(); + return std::string(G->getMachineFunction().getName()); } static bool renderGraphFromBottomUp() { @@ -164,6 +164,20 @@ void SelectionDAG::viewGraph() { viewGraph(""); } +/// Just dump dot graph to a user-provided path and title. +/// This doesn't open the dot viewer program and +/// helps visualization when outside debugging session. +/// FileName expects absolute path. If provided +/// without any path separators then the file +/// will be created in the current directory. +/// Error will be emitted if the path is insane. +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +LLVM_DUMP_METHOD void SelectionDAG::dumpDotGraph(const Twine &FileName, + const Twine &Title) { + dumpDotGraphToFile(this, FileName, Title); +} +#endif + /// clearGraphAttrs - Clear all previously defined node graph attributes. /// Intended to be used from a debugging tool (eg. gdb). void SelectionDAG::clearGraphAttrs() { -- cgit v1.2.3