Skip to content

Commit 5b39f53

Browse files
committed
---
yaml --- r: 349199 b: refs/heads/master-next c: c99f12f h: refs/heads/master i: 349197: cbbf936 349195: 4305590 349191: 7cda334 349183: 6bc6df8
1 parent fba8545 commit 5b39f53

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 003876158ca5f92d98e5dd12e583c68ddc437676
3+
refs/heads/master-next: c99f12ff40010c3266f68e07ba3612f0538053a1
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/lib/SILOptimizer/FunctionSignatureTransforms/FunctionSignatureOpts.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ static llvm::cl::opt<bool>
7070
llvm::cl::desc("Support function signature optimization "
7171
"of generic functions"));
7272

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+
7379
static bool isSpecializableRepresentation(SILFunctionTypeRepresentation Rep,
7480
bool OptForPartialApply) {
7581
switch (Rep) {
@@ -632,6 +638,9 @@ bool FunctionSignatureTransform::run(bool hasCaller) {
632638
return false;
633639
}
634640

641+
// If we are asked to assume a caller for testing purposes, set the flag.
642+
hasCaller |= FSOOptimizeIfNotCalled;
643+
635644
if (!hasCaller && (F->getDynamicallyReplacedFunction() ||
636645
canBeCalledIndirectly(F->getRepresentation()))) {
637646
LLVM_DEBUG(llvm::dbgs() << " function has no caller -> abort\n");

0 commit comments

Comments
 (0)