Skip to content

Commit 760c554

Browse files
authored
Merge pull request swiftlang#21071 from gottesmm/pr-69c27fc73b3ad6caed7e8abba9ae887be6bb6a24
2 parents 2b3eb6a + f38b782 commit 760c554

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/SILOptimizer/Transforms/OwnershipModelEliminator.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@
2828
#include "swift/SIL/SILFunction.h"
2929
#include "swift/SIL/SILVisitor.h"
3030
#include "swift/SILOptimizer/PassManager/Transforms.h"
31+
#include "llvm/Support/CommandLine.h"
3132

3233
using namespace swift;
3334

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+
3440
//===----------------------------------------------------------------------===//
3541
// Implementation
3642
//===----------------------------------------------------------------------===//
@@ -282,6 +288,10 @@ namespace {
282288

283289
struct OwnershipModelEliminator : SILModuleTransform {
284290
void run() override {
291+
if (DumpBefore.size()) {
292+
getModule()->dump(DumpBefore.c_str());
293+
}
294+
285295
for (auto &F : *getModule()) {
286296
// Don't rerun early lowering on deserialized functions.
287297
if (F.wasDeserializedCanonical())

0 commit comments

Comments
 (0)