File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
lib/SILOptimizer/Transforms Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 28
28
#include " swift/SIL/SILFunction.h"
29
29
#include " swift/SIL/SILVisitor.h"
30
30
#include " swift/SILOptimizer/PassManager/Transforms.h"
31
+ #include " llvm/Support/CommandLine.h"
31
32
32
33
using namespace swift ;
33
34
35
+ // Utility command line argument to dump the module before we eliminate
36
+ // ownership from it.
37
+ static llvm::cl::opt<std::string>
38
+ DumpBefore (" sil-dump-before-ome-to-path" , llvm::cl::Hidden);
39
+
34
40
// ===----------------------------------------------------------------------===//
35
41
// Implementation
36
42
// ===----------------------------------------------------------------------===//
@@ -282,6 +288,10 @@ namespace {
282
288
283
289
struct OwnershipModelEliminator : SILModuleTransform {
284
290
void run () override {
291
+ if (DumpBefore.size ()) {
292
+ getModule ()->dump (DumpBefore.c_str ());
293
+ }
294
+
285
295
for (auto &F : *getModule ()) {
286
296
// Don't rerun early lowering on deserialized functions.
287
297
if (F.wasDeserializedCanonical ())
You can’t perform that action at this time.
0 commit comments