File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
branches/master-next/lib/SILOptimizer/FunctionSignatureTransforms Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3
- refs/heads/master-next: 003876158ca5f92d98e5dd12e583c68ddc437676
3
+ refs/heads/master-next: c99f12ff40010c3266f68e07ba3612f0538053a1
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
6
6
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ static llvm::cl::opt<bool>
70
70
llvm::cl::desc(" Support function signature optimization "
71
71
" of generic functions" ));
72
72
73
+ static llvm::cl::opt<bool >
74
+ FSOOptimizeIfNotCalled (" sil-fso-optimize-if-not-called" ,
75
+ llvm::cl::init (false ),
76
+ llvm::cl::desc(" Optimize even if a function isn't "
77
+ " called. For testing only!" ));
78
+
73
79
static bool isSpecializableRepresentation (SILFunctionTypeRepresentation Rep,
74
80
bool OptForPartialApply) {
75
81
switch (Rep) {
@@ -632,6 +638,9 @@ bool FunctionSignatureTransform::run(bool hasCaller) {
632
638
return false ;
633
639
}
634
640
641
+ // If we are asked to assume a caller for testing purposes, set the flag.
642
+ hasCaller |= FSOOptimizeIfNotCalled;
643
+
635
644
if (!hasCaller && (F->getDynamicallyReplacedFunction () ||
636
645
canBeCalledIndirectly (F->getRepresentation ()))) {
637
646
LLVM_DEBUG (llvm::dbgs () << " function has no caller -> abort\n " );
You can’t perform that action at this time.
0 commit comments