[llvm] Add option to dump IR to files intstead of stderr (PR #66412)

Ellis Hoag via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 13:57:21 PDT 2023


================
@@ -103,6 +103,13 @@ static cl::list<std::string>
                             "options"),
                    cl::CommaSeparated, cl::Hidden);
 
+static cl::opt<std::string> IRDumpDirectory(
+    "ir-dump-directory",
+    llvm::cl::desc("If specified, IR printed using the "
+                   "-print-[before|after]{-all} options will be dumped into "
+                   "files in this directory rather than written to stderr"),
+    cl::init(""), cl::Hidden, cl::value_desc("filename"));
----------------
ellishg wrote:

```suggestion
    cl::Hidden, cl::value_desc("filename"));
```

The empty string should already be the default value

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


More information about the llvm-commits mailing list