Skip to content

Commit 40f1837

Browse files
committed
NFC: Rename BridgedArrayRef -> BridgedErasedArrayRef
1 parent dacdb8f commit 40f1837

File tree

17 files changed

+197
-183
lines changed

17 files changed

+197
-183
lines changed

SwiftCompilerSources/Sources/Basic/Utils.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ extension String {
142142
}
143143

144144
extension Array {
145-
public func withBridgedArrayRef<T>(_ c: (BridgedArrayRef) -> T) -> T {
145+
public func withBridgedArrayRef<T>(_ c: (BridgedErasedArrayRef) -> T) -> T {
146146
return withUnsafeBytes { buf in
147-
return c(BridgedArrayRef(data: buf.baseAddress!, count: count))
147+
return c(BridgedErasedArrayRef(data: buf.baseAddress!, count: count))
148148
}
149149
}
150150
}
@@ -171,7 +171,7 @@ extension Optional where Wrapped == UnsafeMutablePointer<BridgedSwiftObject> {
171171
}
172172
}
173173

174-
extension BridgedArrayRef {
174+
extension BridgedErasedArrayRef {
175175
public func withElements<T, R>(ofType ty: T.Type, _ c: (UnsafeBufferPointer<T>) -> R) -> R {
176176
let start = data?.bindMemory(to: ty, capacity: count)
177177
let buffer = UnsafeBufferPointer(start: start, count: count)

SwiftCompilerSources/Sources/Optimizer/Utilities/BorrowedFromUpdater.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func registerBorrowedFromUpdater() {
105105
let function = bridgedFunction.function;
106106
updateBorrowedFrom(in: function, context)
107107
},
108-
{ (bridgedCtxt: BridgedPassContext, bridgedPhiArray: BridgedArrayRef) in
108+
{ (bridgedCtxt: BridgedPassContext, bridgedPhiArray: BridgedErasedArrayRef) in
109109
let context = FunctionPassContext(_bridged: bridgedCtxt)
110110
var guaranteedPhis = Stack<Phi>(context)
111111
defer { guaranteedPhis.deinitialize() }

SwiftCompilerSources/Sources/SIL/Function.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ extension Function {
418418
s._withBridgedStringRef { $0.write(os) }
419419
},
420420
// parseFn:
421-
{ (f: BridgedFunction, str: BridgedStringRef, mode: BridgedFunction.ParseEffectsMode, argumentIndex: Int, paramNames: BridgedArrayRef) -> BridgedFunction.ParsingError in
421+
{ (f: BridgedFunction, str: BridgedStringRef, mode: BridgedFunction.ParseEffectsMode, argumentIndex: Int, paramNames: BridgedErasedArrayRef) -> BridgedFunction.ParsingError in
422422
do {
423423
var parser = StringParser(String(str))
424424
let function = f.function

include/swift/AST/ASTBridging.h

Lines changed: 62 additions & 56 deletions
Large diffs are not rendered by default.

include/swift/Basic/BasicBridging.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,23 @@ void assertFail(const char * _Nonnull msg, const char * _Nonnull file,
114114
// MARK: ArrayRef
115115
//===----------------------------------------------------------------------===//
116116

117-
class BridgedArrayRef {
117+
class BridgedErasedArrayRef {
118118
public:
119119
SWIFT_UNAVAILABLE("Use '.data' instead")
120120
const void *_Nullable Data;
121121

122122
SWIFT_UNAVAILABLE("Use '.count' instead")
123123
size_t Length;
124124

125-
BridgedArrayRef() : Data(nullptr), Length(0) {}
125+
BridgedErasedArrayRef() : Data(nullptr), Length(0) {}
126126

127127
SWIFT_NAME("init(data:count:)")
128-
BridgedArrayRef(const void *_Nullable data, size_t length)
128+
BridgedErasedArrayRef(const void *_Nullable data, size_t length)
129129
: Data(data), Length(length) {}
130130

131131
#ifdef USED_IN_CPP_SOURCE
132132
template <typename T>
133-
BridgedArrayRef(llvm::ArrayRef<T> arr)
133+
BridgedErasedArrayRef(llvm::ArrayRef<T> arr)
134134
: Data(arr.data()), Length(arr.size()) {}
135135

136136
template <typename T>
@@ -140,12 +140,12 @@ class BridgedArrayRef {
140140
#endif
141141
};
142142

143-
SWIFT_NAME("getter:BridgedArrayRef.data(self:)")
143+
SWIFT_NAME("getter:BridgedErasedArrayRef.data(self:)")
144144
BRIDGED_INLINE
145-
const void *_Nullable BridgedArrayRef_data(BridgedArrayRef arr);
145+
const void *_Nullable BridgedErasedArrayRef_data(BridgedErasedArrayRef arr);
146146

147-
SWIFT_NAME("getter:BridgedArrayRef.count(self:)")
148-
BRIDGED_INLINE SwiftInt BridgedArrayRef_count(BridgedArrayRef arr);
147+
SWIFT_NAME("getter:BridgedErasedArrayRef.count(self:)")
148+
BRIDGED_INLINE SwiftInt BridgedErasedArrayRef_count(BridgedErasedArrayRef arr);
149149

150150
//===----------------------------------------------------------------------===//
151151
// MARK: Data

include/swift/Basic/BasicBridgingImpl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
1717

1818
//===----------------------------------------------------------------------===//
19-
// MARK: BridgedArrayRef
19+
// MARK: BridgedErasedArrayRef
2020
//===----------------------------------------------------------------------===//
2121

22-
const void *_Nullable BridgedArrayRef_data(BridgedArrayRef arr) {
22+
const void *_Nullable BridgedErasedArrayRef_data(BridgedErasedArrayRef arr) {
2323
return arr.Data;
2424
}
2525

26-
SwiftInt BridgedArrayRef_count(BridgedArrayRef arr) {
26+
SwiftInt BridgedErasedArrayRef_count(BridgedErasedArrayRef arr) {
2727
return static_cast<SwiftInt>(arr.Length);
2828
}
2929

include/swift/SIL/SILBridging.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct OptionalBridgedResultInfo {
112112
};
113113

114114
struct BridgedResultInfoArray {
115-
BridgedArrayRef resultInfoArray;
115+
BridgedErasedArrayRef resultInfoArray;
116116

117117
#ifdef USED_IN_CPP_SOURCE
118118
BridgedResultInfoArray(llvm::ArrayRef<swift::SILResultInfo> results)
@@ -215,7 +215,7 @@ struct BridgedParameterInfo {
215215
};
216216

217217
struct BridgedParameterInfoArray {
218-
BridgedArrayRef parameterInfoArray;
218+
BridgedErasedArrayRef parameterInfoArray;
219219

220220
#ifdef USED_IN_CPP_SOURCE
221221
BridgedParameterInfoArray(llvm::ArrayRef<swift::SILParameterInfo> parameters)
@@ -233,7 +233,7 @@ struct BridgedParameterInfoArray {
233233
};
234234

235235
struct BridgedYieldInfoArray {
236-
BridgedArrayRef yieldInfoArray;
236+
BridgedErasedArrayRef yieldInfoArray;
237237

238238
#ifdef USED_IN_CPP_SOURCE
239239
BridgedYieldInfoArray(llvm::ArrayRef<swift::SILYieldInfo> yields)
@@ -271,7 +271,7 @@ struct BridgedLifetimeDependenceInfo {
271271
};
272272

273273
struct BridgedLifetimeDependenceInfoArray {
274-
BridgedArrayRef lifetimeDependenceInfoArray;
274+
BridgedErasedArrayRef lifetimeDependenceInfoArray;
275275

276276
#ifdef USED_IN_CPP_SOURCE
277277
BridgedLifetimeDependenceInfoArray(
@@ -704,10 +704,9 @@ struct BridgedFunction {
704704

705705
typedef void (* _Nonnull RegisterFn)(BridgedFunction f, void * _Nonnull data, SwiftInt size);
706706
typedef void (* _Nonnull WriteFn)(BridgedFunction, BridgedOStream, SwiftInt);
707-
typedef ParsingError (*_Nonnull ParseFn)(BridgedFunction,
708-
BridgedStringRef,
707+
typedef ParsingError (*_Nonnull ParseFn)(BridgedFunction, BridgedStringRef,
709708
ParseEffectsMode, SwiftInt,
710-
BridgedArrayRef);
709+
BridgedErasedArrayRef);
711710
typedef SwiftInt (* _Nonnull CopyEffectsFn)(BridgedFunction, BridgedFunction);
712711
typedef EffectInfo (* _Nonnull GetEffectInfoFn)(BridgedFunction, SwiftInt);
713712
typedef BridgedMemoryBehavior (* _Nonnull GetMemBehaviorFn)(BridgedFunction, bool);
@@ -778,7 +777,7 @@ struct BridgedSubstitutionMap {
778777
};
779778

780779
struct BridgedTypeArray {
781-
BridgedArrayRef typeArray;
780+
BridgedErasedArrayRef typeArray;
782781

783782
// Ensure that this struct value type will be indirectly returned on
784783
// Windows ARM64,
@@ -802,7 +801,7 @@ struct BridgedTypeArray {
802801
};
803802

804803
struct BridgedSILTypeArray {
805-
BridgedArrayRef typeArray;
804+
BridgedErasedArrayRef typeArray;
806805

807806
#ifdef USED_IN_CPP_SOURCE
808807
BridgedSILTypeArray(llvm::ArrayRef<swift::SILType> silTypes)

include/swift/SILOptimizer/OptimizerBridging.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ struct BridgedPostDomTree {
140140
struct BridgedUtilities {
141141
typedef void (* _Nonnull VerifyFunctionFn)(BridgedPassContext, BridgedFunction);
142142
typedef void (* _Nonnull UpdateBorrowedFromFn)(BridgedPassContext, BridgedFunction);
143-
typedef void (* _Nonnull UpdateBorrowedFromPhisFn)(BridgedPassContext, BridgedArrayRef);
143+
typedef void (*_Nonnull UpdateBorrowedFromPhisFn)(BridgedPassContext,
144+
BridgedErasedArrayRef);
144145

145146
static void registerVerifier(VerifyFunctionFn verifyFunctionFn);
146147
static void registerBorrowedFromUpdater(UpdateBorrowedFromFn updateBorrowedFromFn,
@@ -257,9 +258,10 @@ struct BridgedPassContext {
257258
BridgedOwnedString mangleWithDeadArgs(const SwiftInt * _Nullable deadArgs,
258259
SwiftInt numDeadArgs,
259260
BridgedFunction function) const;
260-
BridgedOwnedString mangleWithClosureArgs(BridgedValueArray closureArgs,
261-
BridgedArrayRef closureArgIndices,
262-
BridgedFunction applySiteCallee) const;
261+
BridgedOwnedString
262+
mangleWithClosureArgs(BridgedValueArray closureArgs,
263+
BridgedErasedArrayRef closureArgIndices,
264+
BridgedFunction applySiteCallee) const;
263265

264266
SWIFT_IMPORT_UNSAFE BridgedGlobalVar createGlobalVariable(BridgedStringRef name, BridgedType type,
265267
bool isPrivate) const;

0 commit comments

Comments
 (0)