Skip to content

Commit 1e08317

Browse files
committed
Format sources.
1 parent b6b7224 commit 1e08317

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

include/swift/AST/CASTBridging.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ struct FuncDeclBridged {
160160
void *decl;
161161
};
162162

163-
struct FuncDeclBridged FuncDecl_create(void *ctx, void *staticLoc, _Bool isStatic, void *funcLoc,
164-
BridgedIdentifier name, void *nameLoc, _Bool isAsync,
165-
void *_Nullable asyncLoc, _Bool throws,
166-
void *_Nullable throwsLoc, void *paramLLoc,
167-
BridgedArrayRef params, void *paramRLoc,
168-
void *_Nullable returnType,
169-
void *declContext);
163+
struct FuncDeclBridged
164+
FuncDecl_create(void *ctx, void *staticLoc, _Bool isStatic, void *funcLoc,
165+
BridgedIdentifier name, void *nameLoc, _Bool isAsync,
166+
void *_Nullable asyncLoc, _Bool throws,
167+
void *_Nullable throwsLoc, void *paramLLoc,
168+
BridgedArrayRef params, void *paramRLoc,
169+
void *_Nullable returnType, void *declContext);
170170
void FuncDecl_setBody(void *fn, void *body);
171171

172172
void *SimpleIdentTypeRepr_create(void *ctx, void *loc, BridgedIdentifier id);

lib/AST/CASTBridging.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,13 @@ void *ParamDecl_create(void *ctx, void *loc, void *_Nullable argLoc,
220220
return paramDecl;
221221
}
222222

223-
struct FuncDeclBridged FuncDecl_create(void *ctx, void *staticLoc, bool isStatic, void *funcLoc,
224-
BridgedIdentifier name, void *nameLoc, bool isAsync,
225-
void *_Nullable asyncLoc, bool throws,
226-
void *_Nullable throwsLoc, void *paramLLoc,
227-
BridgedArrayRef params, void *paramRLoc,
228-
void *_Nullable returnType,
229-
void *declContext) {
223+
struct FuncDeclBridged
224+
FuncDecl_create(void *ctx, void *staticLoc, bool isStatic, void *funcLoc,
225+
BridgedIdentifier name, void *nameLoc, bool isAsync,
226+
void *_Nullable asyncLoc, bool throws,
227+
void *_Nullable throwsLoc, void *paramLLoc,
228+
BridgedArrayRef params, void *paramRLoc,
229+
void *_Nullable returnType, void *declContext) {
230230
auto *paramList = ParameterList::create(
231231
*static_cast<ASTContext *>(ctx), getSourceLocFromPointer(paramLLoc),
232232
getArrayRef<ParamDecl *>(params), getSourceLocFromPointer(paramRLoc));
@@ -241,7 +241,8 @@ struct FuncDeclBridged FuncDecl_create(void *ctx, void *staticLoc, bool isStatic
241241
getSourceLocFromPointer(throwsLoc), nullptr, paramList,
242242
(TypeRepr *)returnType, (DeclContext *)declContext);
243243

244-
return {static_cast<DeclContext *>(out), static_cast<FuncDecl *>(out), static_cast<Decl *>(out)};
244+
return {static_cast<DeclContext *>(out), static_cast<FuncDecl *>(out),
245+
static_cast<Decl *>(out)};
245246
}
246247

247248
void FuncDecl_setBody(void *fn, void *body) {

lib/ASTGen/Sources/ASTGen/Decls.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ extension ASTGenVisitor {
124124
let nameLoc = self.base.advanced(by: node.identifier.position.utf8Offset).raw
125125
let rParamLoc = self.base.advanced(by: node.signature.input.leftParen.position.utf8Offset).raw
126126
let lParamLoc = self.base.advanced(by: node.signature.input.rightParen.position.utf8Offset).raw
127-
128-
129127

130128
var nameText = node.identifier.text
131129
let name = nameText.withUTF8 { buf in
@@ -142,25 +140,26 @@ extension ASTGenVisitor {
142140
let params = node.signature.input.parameterList.map { visit($0).rawValue }
143141
let out = params.withBridgedArrayRef { ref in
144142
FuncDecl_create(
145-
ctx, staticLoc, false, funcLoc, name, nameLoc, false, nil, false, nil, rParamLoc, ref, lParamLoc,
143+
ctx, staticLoc, false, funcLoc, name, nameLoc, false, nil, false, nil, rParamLoc, ref,
144+
lParamLoc,
146145
returnType?.rawValue, declContext)
147146
}
148-
147+
149148
let oldDeclContext = declContext
150149
declContext = out.declContext
151150
defer { declContext = oldDeclContext }
152-
151+
153152
let body: ASTNode?
154153
if let nodeBody = node.body {
155154
body = visit(nodeBody)
156155
} else {
157156
body = nil
158157
}
159-
158+
160159
if let body = body {
161160
FuncDecl_setBody(out.funcDecl, body.rawValue)
162161
}
163-
162+
164163
return .decl(out.decl)
165164
}
166165
}

lib/ASTGen/Sources/ASTGen/Exprs.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SwiftSyntax
55
extension ASTGenVisitor {
66
public func visit(_ node: ClosureExprSyntax) -> ASTNode {
77
let statements = node.statements.map { self.visit($0).bridged() }
8-
let body = statements.withBridgedArrayRef { ref in
8+
let body: UnsafeMutableRawPointer = statements.withBridgedArrayRef { ref in
99
let startLoc = self.base.advanced(by: node.leftBrace.position.utf8Offset).raw
1010
let endLoc = self.base.advanced(by: node.rightBrace.position.utf8Offset).raw
1111
return BraceStmt_create(ctx, startLoc, ref, endLoc)

0 commit comments

Comments
 (0)