Skip to content

Commit 8d8577e

Browse files
committed
[SIL] Removed Indirect_In_Constant convention.
It is no different from @in. Continue parse @in_constant in textual and serialized SIL, but just as an alias for @in.
1 parent 04471ff commit 8d8577e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+39
-129
lines changed

SwiftCompilerSources/Sources/SIL/Argument.swift

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,6 @@ public enum ArgumentConvention {
8686
/// object.
8787
case indirectIn
8888

89-
/// This argument is passed indirectly, i.e. by directly passing the address
90-
/// of an object in memory. The callee must treat the object as read-only
91-
/// The callee may assume that the address does not alias any valid object.
92-
case indirectInConstant
93-
9489
/// This argument is passed indirectly, i.e. by directly passing the address
9590
/// of an object in memory. The callee may not modify and does not destroy
9691
/// the object.
@@ -130,7 +125,7 @@ public enum ArgumentConvention {
130125

131126
public var isIndirect: Bool {
132127
switch self {
133-
case .indirectIn, .indirectInConstant, .indirectInGuaranteed,
128+
case .indirectIn, .indirectInGuaranteed,
134129
.indirectInout, .indirectInoutAliasable, .indirectOut:
135130
return true
136131
case .directOwned, .directUnowned, .directGuaranteed:
@@ -140,7 +135,7 @@ public enum ArgumentConvention {
140135

141136
public var isIndirectIn: Bool {
142137
switch self {
143-
case .indirectIn, .indirectInConstant, .indirectInGuaranteed:
138+
case .indirectIn, .indirectInGuaranteed:
144139
return true
145140
case .directOwned, .directUnowned, .directGuaranteed,
146141
.indirectInout, .indirectInoutAliasable, .indirectOut:
@@ -152,7 +147,7 @@ public enum ArgumentConvention {
152147
switch self {
153148
case .indirectInGuaranteed, .directGuaranteed:
154149
return true
155-
case .indirectIn, .indirectInConstant, .directOwned, .directUnowned,
150+
case .indirectIn, .directOwned, .directUnowned,
156151
.indirectInout, .indirectInoutAliasable, .indirectOut:
157152
return false
158153
}
@@ -161,7 +156,6 @@ public enum ArgumentConvention {
161156
public var isExclusiveIndirect: Bool {
162157
switch self {
163158
case .indirectIn,
164-
.indirectInConstant,
165159
.indirectOut,
166160
.indirectInGuaranteed,
167161
.indirectInout:
@@ -182,7 +176,6 @@ public enum ArgumentConvention {
182176
return true
183177

184178
case .indirectIn,
185-
.indirectInConstant,
186179
.indirectOut,
187180
.indirectInGuaranteed,
188181
.directUnowned,
@@ -205,7 +198,6 @@ extension BridgedArgumentConvention {
205198
var convention: ArgumentConvention {
206199
switch self {
207200
case ArgumentConvention_Indirect_In: return .indirectIn
208-
case ArgumentConvention_Indirect_In_Constant: return .indirectInConstant
209201
case ArgumentConvention_Indirect_In_Guaranteed: return .indirectInGuaranteed
210202
case ArgumentConvention_Indirect_Inout: return .indirectInout
211203
case ArgumentConvention_Indirect_InoutAliasable: return .indirectInoutAliasable

SwiftCompilerSources/Sources/SIL/Effects.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ public struct SideEffects : CustomStringConvertible, NoReflectionChildren {
491491
result.ownership = SideEffects.Ownership()
492492
}
493493
switch convention {
494-
case .indirectIn, .indirectInConstant:
494+
case .indirectIn:
495495
result.memory.write = false
496496
case .indirectInGuaranteed:
497497
result.memory.write = false

include/swift/AST/Types.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3707,11 +3707,6 @@ enum class ParameterConvention : uint8_t {
37073707
/// object.
37083708
Indirect_In,
37093709

3710-
/// This argument is passed indirectly, i.e. by directly passing the address
3711-
/// of an object in memory. The callee must treat the object as read-only
3712-
/// The callee may assume that the address does not alias any valid object.
3713-
Indirect_In_Constant,
3714-
37153710
/// This argument is passed indirectly, i.e. by directly passing the address
37163711
/// of an object in memory. The callee may not modify and does not destroy
37173712
/// the object.
@@ -3754,7 +3749,6 @@ static_assert(unsigned(ParameterConvention::Direct_Guaranteed) < (1<<3),
37543749
inline bool isIndirectFormalParameter(ParameterConvention conv) {
37553750
switch (conv) {
37563751
case ParameterConvention::Indirect_In:
3757-
case ParameterConvention::Indirect_In_Constant:
37583752
case ParameterConvention::Indirect_Inout:
37593753
case ParameterConvention::Indirect_InoutAliasable:
37603754
case ParameterConvention::Indirect_In_Guaranteed:
@@ -3770,7 +3764,6 @@ inline bool isIndirectFormalParameter(ParameterConvention conv) {
37703764
inline bool isConsumedParameter(ParameterConvention conv) {
37713765
switch (conv) {
37723766
case ParameterConvention::Indirect_In:
3773-
case ParameterConvention::Indirect_In_Constant:
37743767
case ParameterConvention::Direct_Owned:
37753768
return true;
37763769

@@ -3796,7 +3789,6 @@ inline bool isGuaranteedParameter(ParameterConvention conv) {
37963789
case ParameterConvention::Indirect_Inout:
37973790
case ParameterConvention::Indirect_InoutAliasable:
37983791
case ParameterConvention::Indirect_In:
3799-
case ParameterConvention::Indirect_In_Constant:
38003792
case ParameterConvention::Direct_Unowned:
38013793
case ParameterConvention::Direct_Owned:
38023794
return false;

include/swift/SIL/ApplySite.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ class ApplySite {
386386
return pai->isOnStack() ? SILArgumentConvention::Direct_Guaranteed
387387
: SILArgumentConvention::Direct_Owned;
388388
case SILArgumentConvention::Indirect_In:
389-
case SILArgumentConvention::Indirect_In_Constant:
390389
case SILArgumentConvention::Indirect_In_Guaranteed:
391390
return pai->isOnStack() ? SILArgumentConvention::Indirect_In_Guaranteed
392391
: SILArgumentConvention::Indirect_In;

include/swift/SIL/SILArgumentConvention.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ namespace swift {
2525
struct SILArgumentConvention {
2626
enum ConventionType : uint8_t {
2727
Indirect_In,
28-
Indirect_In_Constant,
2928
Indirect_In_Guaranteed,
3029
Indirect_Inout,
3130
Indirect_InoutAliasable,
@@ -43,9 +42,6 @@ struct SILArgumentConvention {
4342
case ParameterConvention::Indirect_In:
4443
Value = SILArgumentConvention::Indirect_In;
4544
return;
46-
case ParameterConvention::Indirect_In_Constant:
47-
Value = SILArgumentConvention::Indirect_In_Constant;
48-
return;
4945
case ParameterConvention::Indirect_Inout:
5046
Value = SILArgumentConvention::Indirect_Inout;
5147
return;
@@ -81,7 +77,6 @@ struct SILArgumentConvention {
8177
return true;
8278
case SILArgumentConvention::Indirect_In_Guaranteed:
8379
case SILArgumentConvention::Indirect_In:
84-
case SILArgumentConvention::Indirect_In_Constant:
8580
case SILArgumentConvention::Indirect_Out:
8681
case SILArgumentConvention::Direct_Unowned:
8782
case SILArgumentConvention::Direct_Owned:
@@ -94,7 +89,6 @@ struct SILArgumentConvention {
9489
bool isOwnedConvention() const {
9590
switch (Value) {
9691
case SILArgumentConvention::Indirect_In:
97-
case SILArgumentConvention::Indirect_In_Constant:
9892
case SILArgumentConvention::Direct_Owned:
9993
return true;
10094
case SILArgumentConvention::Indirect_In_Guaranteed:
@@ -115,7 +109,6 @@ struct SILArgumentConvention {
115109
return true;
116110
case SILArgumentConvention::Indirect_Inout:
117111
case SILArgumentConvention::Indirect_In:
118-
case SILArgumentConvention::Indirect_In_Constant:
119112
case SILArgumentConvention::Indirect_Out:
120113
case SILArgumentConvention::Indirect_InoutAliasable:
121114
case SILArgumentConvention::Direct_Unowned:
@@ -129,7 +122,6 @@ struct SILArgumentConvention {
129122
bool isExclusiveIndirectParameter() {
130123
switch (Value) {
131124
case SILArgumentConvention::Indirect_In:
132-
case SILArgumentConvention::Indirect_In_Constant:
133125
case SILArgumentConvention::Indirect_Out:
134126
case SILArgumentConvention::Indirect_In_Guaranteed:
135127
case SILArgumentConvention::Indirect_Inout:

include/swift/SIL/SILBridging.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ typedef enum {
186186

187187
typedef enum {
188188
ArgumentConvention_Indirect_In,
189-
ArgumentConvention_Indirect_In_Constant,
190189
ArgumentConvention_Indirect_In_Guaranteed,
191190
ArgumentConvention_Indirect_Inout,
192191
ArgumentConvention_Indirect_InoutAliasable,

include/swift/SIL/SILFunctionConventions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ inline bool SILModuleConventions::isIndirectSILParam(SILParameterInfo param,
519519
return false;
520520

521521
case ParameterConvention::Indirect_In:
522-
case ParameterConvention::Indirect_In_Constant:
523522
case ParameterConvention::Indirect_In_Guaranteed:
524523
return (loweredAddresses ||
525524
param.getInterfaceType()->isOpenedExistentialWithError());

lib/AST/ASTDemangler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,8 @@ static ParameterConvention
422422
getParameterConvention(ImplParameterConvention conv) {
423423
switch (conv) {
424424
case Demangle::ImplParameterConvention::Indirect_In:
425-
return ParameterConvention::Indirect_In;
426425
case Demangle::ImplParameterConvention::Indirect_In_Constant:
427-
return ParameterConvention::Indirect_In_Constant;
426+
return ParameterConvention::Indirect_In;
428427
case Demangle::ImplParameterConvention::Indirect_In_Guaranteed:
429428
return ParameterConvention::Indirect_In_Guaranteed;
430429
case Demangle::ImplParameterConvention::Indirect_Inout:

lib/AST/ASTMangler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,8 +1861,6 @@ static char getParamConvention(ParameterConvention conv) {
18611861
// different places.
18621862
switch (conv) {
18631863
case ParameterConvention::Indirect_In: return 'i';
1864-
case ParameterConvention::Indirect_In_Constant:
1865-
return 'c';
18661864
case ParameterConvention::Indirect_Inout: return 'l';
18671865
case ParameterConvention::Indirect_InoutAliasable: return 'b';
18681866
case ParameterConvention::Indirect_In_Guaranteed: return 'n';

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6197,7 +6197,6 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
61976197
Printer << "@callee_guaranteed ";
61986198
return;
61996199
case ParameterConvention::Indirect_In:
6200-
case ParameterConvention::Indirect_In_Constant:
62016200
case ParameterConvention::Indirect_Inout:
62026201
case ParameterConvention::Indirect_InoutAliasable:
62036202
case ParameterConvention::Indirect_In_Guaranteed:
@@ -6815,8 +6814,6 @@ std::string GenericSignature::getAsString() const {
68156814
static StringRef getStringForParameterConvention(ParameterConvention conv) {
68166815
switch (conv) {
68176816
case ParameterConvention::Indirect_In: return "@in ";
6818-
case ParameterConvention::Indirect_In_Constant:
6819-
return "@in_constant ";
68206817
case ParameterConvention::Indirect_In_Guaranteed: return "@in_guaranteed ";
68216818
case ParameterConvention::Indirect_Inout: return "@inout ";
68226819
case ParameterConvention::Indirect_InoutAliasable: return "@inout_aliasable ";

0 commit comments

Comments
 (0)