File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 19
19
#include " swift/SIL/SILBuilder.h"
20
20
#include " swift/SILOptimizer/Utils/CastOptimizer.h"
21
21
#include " swift/SILOptimizer/Utils/Local.h"
22
+ #include " swift/SIL/InstructionUtils.h"
22
23
#include " llvm/ADT/APFloat.h"
23
24
#include " llvm/ADT/APSInt.h"
24
25
#include " llvm/ADT/Statistic.h"
@@ -1527,7 +1528,11 @@ static bool
1527
1528
constantFoldGlobalStringTablePointerBuiltin (BuiltinInst *bi,
1528
1529
bool enableDiagnostics) {
1529
1530
// Look through string initializer to extract the string_literal instruction.
1530
- SILValue builtinOperand = bi->getOperand (0 );
1531
+ //
1532
+ // We allow for a single borrow to be stripped here if we are here in
1533
+ // [ossa]. The begin borrow occurs b/c SILGen treats builtins as having
1534
+ // arguments with a +0 convention (implying a borrow).
1535
+ SILValue builtinOperand = stripBorrow (bi->getOperand (0 ));
1531
1536
SILFunction *caller = bi->getFunction ();
1532
1537
1533
1538
FullApplySite stringInitSite = FullApplySite::isa (builtinOperand);
Original file line number Diff line number Diff line change 1
1
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
2
+ // RUN: %target-swift-frontend -emit-sil -enable-ownership-stripping-after-serialization -primary-file %s -o /dev/null -verify
2
3
//
3
4
// These are tests for diagnostics produced by constant propagation pass.
4
5
// Due to the change in the implementation of Integer initializers some of the
You can’t perform that action at this time.
0 commit comments