Skip to content

Commit 2b90daf

Browse files
committed
Format sources.
1 parent 2c1b76c commit 2b90daf

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

include/swift/AST/CASTBridging.h

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

162-
struct FuncDeclBridged FuncDecl_create(void *ctx, void *staticLoc, _Bool isStatic, void *funcLoc,
163-
BridgedIdentifier name, void *nameLoc, _Bool isAsync,
164-
void *_Nullable asyncLoc, _Bool throws,
165-
void *_Nullable throwsLoc, void *paramLLoc,
166-
BridgedArrayRef params, void *paramRLoc,
167-
void *_Nullable returnType,
168-
void *declContext);
162+
struct FuncDeclBridged
163+
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, void *declContext);
169169
void FuncDecl_setBody(void *fn, void *body);
170170

171171
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
@@ -210,13 +210,13 @@ void *ParamDecl_create(void *ctx, void *loc, void *_Nullable argLoc,
210210
return paramDecl;
211211
}
212212

213-
struct FuncDeclBridged FuncDecl_create(void *ctx, void *staticLoc, bool isStatic, void *funcLoc,
214-
BridgedIdentifier name, void *nameLoc, bool isAsync,
215-
void *_Nullable asyncLoc, bool throws,
216-
void *_Nullable throwsLoc, void *paramLLoc,
217-
BridgedArrayRef params, void *paramRLoc,
218-
void *_Nullable returnType,
219-
void *declContext) {
213+
struct FuncDeclBridged
214+
FuncDecl_create(void *ctx, void *staticLoc, bool isStatic, void *funcLoc,
215+
BridgedIdentifier name, void *nameLoc, bool isAsync,
216+
void *_Nullable asyncLoc, bool throws,
217+
void *_Nullable throwsLoc, void *paramLLoc,
218+
BridgedArrayRef params, void *paramRLoc,
219+
void *_Nullable returnType, void *declContext) {
220220
auto *paramList = ParameterList::create(
221221
*static_cast<ASTContext *>(ctx), getSourceLocFromPointer(paramLLoc),
222222
getArrayRef<ParamDecl *>(params), getSourceLocFromPointer(paramRLoc));
@@ -231,7 +231,8 @@ struct FuncDeclBridged FuncDecl_create(void *ctx, void *staticLoc, bool isStatic
231231
getSourceLocFromPointer(throwsLoc), nullptr, paramList,
232232
(TypeRepr *)returnType, (DeclContext *)declContext);
233233

234-
return {static_cast<DeclContext *>(out), static_cast<FuncDecl *>(out), static_cast<Decl *>(out)};
234+
return {static_cast<DeclContext *>(out), static_cast<FuncDecl *>(out),
235+
static_cast<Decl *>(out)};
235236
}
236237

237238
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
@@ -121,8 +121,6 @@ extension ASTGenVisitor {
121121
let nameLoc = self.base.advanced(by: node.identifier.position.utf8Offset).raw
122122
let rParamLoc = self.base.advanced(by: node.signature.input.leftParen.position.utf8Offset).raw
123123
let lParamLoc = self.base.advanced(by: node.signature.input.rightParen.position.utf8Offset).raw
124-
125-
126124

127125
var nameText = node.identifier.text
128126
let name = nameText.withUTF8 { buf in
@@ -139,25 +137,26 @@ extension ASTGenVisitor {
139137
let params = node.signature.input.parameterList.map { visit($0).rawValue }
140138
let out = params.withBridgedArrayRef { ref in
141139
FuncDecl_create(
142-
ctx, staticLoc, false, funcLoc, name, nameLoc, false, nil, false, nil, rParamLoc, ref, lParamLoc,
140+
ctx, staticLoc, false, funcLoc, name, nameLoc, false, nil, false, nil, rParamLoc, ref,
141+
lParamLoc,
143142
returnType?.rawValue, declContext)
144143
}
145-
144+
146145
let oldDeclContext = declContext
147146
declContext = out.declContext
148147
defer { declContext = oldDeclContext }
149-
148+
150149
let body: ASTNode?
151150
if let nodeBody = node.body {
152151
body = visit(nodeBody)
153152
} else {
154153
body = nil
155154
}
156-
155+
157156
if let body = body {
158157
FuncDecl_setBody(out.funcDecl, body.rawValue)
159158
}
160-
159+
161160
return .decl(out.decl)
162161
}
163162
}

0 commit comments

Comments
 (0)