[llvm] [CFGPrinter] Allow CFG dumps with a given filename (PR #112906)

via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 3 08:19:10 PST 2024


================
@@ -942,9 +942,14 @@ class LLVM_ABI Function : public GlobalObject, public ilist_node<Function> {
   ///
   void viewCFG() const;
 
+  /// viewCFG - This function is meant for use from the debugger. It works just
+  /// like viewCFG(), but generates the dot file with the given filename.
+  void viewCFG(const char *Name) const;
+
   /// Extended form to print edge weights.
   void viewCFG(bool ViewCFGOnly, const BlockFrequencyInfo *BFI,
-               const BranchProbabilityInfo *BPI) const;
+               const BranchProbabilityInfo *BPI,
+               const char *Name = nullptr) const;
----------------
WenleiHe wrote:

nit: `Name` -> `outputFileName` to be explicit. 

https://github.com/llvm/llvm-project/pull/112906


More information about the llvm-commits mailing list