File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
trunk/lib/SILOptimizer/UtilityPasses Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 635eef202f6ca5ea62f0360767ad0cf2aaaef06b
2
+ refs/heads/master: abe703a4fd50a909198ed13d7c8c3ce8a8f605f5
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
Original file line number Diff line number Diff line change @@ -29,19 +29,37 @@ using namespace swift;
29
29
// Options
30
30
// ===----------------------------------------------------------------------===//
31
31
32
+ llvm::cl::opt<std::string> SILViewCFGOnlyFun (
33
+ " sil-view-cfg-only-function" , llvm::cl::init(" " ),
34
+ llvm::cl::desc(" Only produce a graphviz file for this function" ));
35
+
36
+ llvm::cl::opt<std::string> SILViewCFGOnlyFuns (
37
+ " sil-view-cfg-only-functions" , llvm::cl::init(" " ),
38
+ llvm::cl::desc(" Only produce a graphviz file for the sil for the functions "
39
+ " whose name contains this substring" ));
40
+
32
41
// ===----------------------------------------------------------------------===//
33
42
// Top Level Driver
34
43
// ===----------------------------------------------------------------------===//
35
44
36
45
namespace {
46
+
37
47
class SILCFGPrinter : public SILFunctionTransform {
38
48
// / The entry point to the transformation.
39
49
void run () override {
40
50
SILFunction *F = getFunction ();
41
51
52
+ // If we are not supposed to dump view this cfg, return.
53
+ if (!SILViewCFGOnlyFun.empty () && F && F->getName () != SILViewCFGOnlyFun)
54
+ return ;
55
+ if (!SILViewCFGOnlyFuns.empty () && F &&
56
+ F->getName ().find (SILViewCFGOnlyFuns, 0 ) == StringRef::npos)
57
+ return ;
58
+
42
59
F->viewCFG ();
43
60
}
44
61
};
62
+
45
63
} // end anonymous namespace
46
64
47
65
SILTransform *swift::createCFGPrinter () {
You can’t perform that action at this time.
0 commit comments