Skip to content

Commit 85399f5

Browse files
authored
Merge pull request #61811 from zoecarver/format-astgen-sources
[nfc] Run swift,clang-format over ASTGen sources.
2 parents d1fbdcc + b81cb50 commit 85399f5

File tree

13 files changed

+357
-312
lines changed

13 files changed

+357
-312
lines changed

include/swift/AST/CASTBridging.h

Lines changed: 58 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef SWIFT_C_AST_ASTBRIDGING_H
1414
#define SWIFT_C_AST_ASTBRIDGING_H
1515

16-
#include <inttypes.h>
1716
#include "swift/Basic/Compiler.h"
17+
#include <inttypes.h>
1818

1919
#if __clang__
2020
// Provide macros to temporarily suppress warning about the use of
@@ -93,9 +93,9 @@ extern "C" {
9393

9494
#endif
9595

96-
BridgedIdentifier
97-
SwiftASTContext_getIdentifier(
98-
void *ctx, const uint8_t * _Nullable str, long len);
96+
BridgedIdentifier SwiftASTContext_getIdentifier(void *ctx,
97+
const uint8_t *_Nullable str,
98+
long len);
9999

100100
void *SwiftImportDecl_create(void *, void *, void *, char, void *,
101101
BridgedArrayRef, BridgedArrayRef);
@@ -107,7 +107,6 @@ void *SwiftTopLevelCodeDecl_createExpr(void *ctx, void *DC, void *startLoc,
107107

108108
void *ReturnStmt_create(void *ctx, void *loc, void *_Nullable expr);
109109

110-
111110
void *SwiftSequenceExpr_create(void *ctx, BridgedArrayRef exprs);
112111

113112
void *SwiftTupleExpr_create(void *ctx, void *lparen, BridgedArrayRef subs,
@@ -117,46 +116,48 @@ void *SwiftFunctionCallExpr_create(void *ctx, void *fn, void *args);
117116

118117
void *SwiftIdentifierExpr_create(void *ctx, BridgedIdentifier base, void *loc);
119118

120-
void *SwiftStringLiteralExpr_create(void *ctx, const uint8_t * _Nullable string,
119+
void *SwiftStringLiteralExpr_create(void *ctx, const uint8_t *_Nullable string,
121120
long len, void *TokenLoc);
122121

123-
void *SwiftIntegerLiteralExpr_create(void *ctx, const uint8_t * _Nullable string,
124-
long len, void *TokenLoc);
122+
void *SwiftIntegerLiteralExpr_create(void *ctx, const uint8_t *_Nullable string,
123+
long len, void *TokenLoc);
125124

126125
void *SwiftBooleanLiteralExpr_create(void *ctx, _Bool value, void *TokenLoc);
127126

128127
void *SwiftVarDecl_create(void *ctx, BridgedIdentifier _Nullable name,
129128
void *loc, _Bool isStatic, _Bool isLet, void *dc);
130129

131-
void *IfStmt_create(void *ctx, void *ifLoc, void *cond, void *_Nullable then, void *_Nullable elseLoc,
132-
void *_Nullable elseStmt);
130+
void *IfStmt_create(void *ctx, void *ifLoc, void *cond, void *_Nullable then,
131+
void *_Nullable elseLoc, void *_Nullable elseStmt);
133132

134133
struct ASTNodeBridged {
135134
void *ptr;
136135
_Bool isExpr; // Must be expr or stmt.
137136
};
138137

139-
void *BraceStmt_create(void *ctx, void *lbloc, BridgedArrayRef elements, void *rbloc);
140-
void *BraceStmt_create(void *ctx, void *lbloc, BridgedArrayRef elements, void *rbloc);
138+
void *BraceStmt_create(void *ctx, void *lbloc, BridgedArrayRef elements,
139+
void *rbloc);
140+
void *BraceStmt_create(void *ctx, void *lbloc, BridgedArrayRef elements,
141+
void *rbloc);
141142

142143
void *BridgedSourceLoc_advanced(void *loc, long len);
143144

144-
void *ParamDecl_create(void *ctx, void *loc,
145-
void *_Nullable argLoc, void *_Nullable argName,
146-
void *_Nullable paramLoc, void *_Nullable paramName,
147-
void *declContext);
145+
void *ParamDecl_create(void *ctx, void *loc, void *_Nullable argLoc,
146+
void *_Nullable argName, void *_Nullable paramLoc,
147+
void *_Nullable paramName, void *declContext);
148148

149149
void *FuncDecl_create(void *ctx, void *staticLoc, _Bool isStatic, void *funcLoc,
150-
BridgedIdentifier name, void *nameLoc,
151-
_Bool isAsync, void *_Nullable asyncLoc,
152-
_Bool throws, void *_Nullable throwsLoc,
153-
void *paramLLoc, BridgedArrayRef params, void *paramRLoc,
150+
BridgedIdentifier name, void *nameLoc, _Bool isAsync,
151+
void *_Nullable asyncLoc, _Bool throws,
152+
void *_Nullable throwsLoc, void *paramLLoc,
153+
BridgedArrayRef params, void *paramRLoc,
154154
void *_Nullable body, void *_Nullable returnType,
155155
void *declContext);
156156

157157
void *SimpleIdentTypeRepr_create(void *ctx, void *loc, BridgedIdentifier id);
158158

159-
void *UnresolvedDotExpr_create(void *ctx, void *base, void *dotLoc, BridgedIdentifier name, void *nameLoc);
159+
void *UnresolvedDotExpr_create(void *ctx, void *base, void *dotLoc,
160+
BridgedIdentifier name, void *nameLoc);
160161

161162
void *ClosureExpr_create(void *ctx, void *body, void *dc);
162163

@@ -168,34 +169,54 @@ struct DeclContextAndDecl {
168169
void *decl;
169170
};
170171

171-
struct DeclContextAndDecl StructDecl_create(
172-
void *ctx, void *loc, BridgedIdentifier name, void *nameLoc, void *_Nullable genericParams, void *dc);
173-
struct DeclContextAndDecl ClassDecl_create(
174-
void *ctx, void *loc, BridgedIdentifier name, void *nameLoc, void *dc);
175-
176-
void *ArrayTypeRepr_create(void *ctx, void *base, void *lsquareLoc, void *rsquareLoc);
177-
void *DictionaryTypeRepr_create(void *ctx, void *keyType, void *valueType, void *lsquareLoc, void *colonloc, void *rsquareLoc);
172+
struct DeclContextAndDecl
173+
StructDecl_create(void *ctx, void *loc, BridgedIdentifier name, void *nameLoc,
174+
void *_Nullable genericParams, void *dc);
175+
struct DeclContextAndDecl ClassDecl_create(void *ctx, void *loc,
176+
BridgedIdentifier name,
177+
void *nameLoc, void *dc);
178+
179+
void *ArrayTypeRepr_create(void *ctx, void *base, void *lsquareLoc,
180+
void *rsquareLoc);
181+
void *DictionaryTypeRepr_create(void *ctx, void *keyType, void *valueType,
182+
void *lsquareLoc, void *colonloc,
183+
void *rsquareLoc);
178184
void *OptionalTypeRepr_create(void *ctx, void *base, void *questionLoc);
179-
void *ImplicitlyUnwrappedOptionalTypeRepr_create(void *ctx, void *base, void *exclamationLoc);
185+
void *ImplicitlyUnwrappedOptionalTypeRepr_create(void *ctx, void *base,
186+
void *exclamationLoc);
180187
void *MetatypeTypeRepr_create(void *ctx, void *baseType, void *typeLoc);
181188
void *ProtocolTypeRepr_create(void *ctx, void *baseType, void *protoLoc);
182189
void *PackExpansionTypeRepr_create(void *ctx, void *base, void *ellipsisLoc);
183-
void *TupleTypeRepr_create(void *ctx, BridgedArrayRef elements, void *lParenLoc, void *rParenLoc);
190+
void *TupleTypeRepr_create(void *ctx, BridgedArrayRef elements, void *lParenLoc,
191+
void *rParenLoc);
184192
void *IdentTypeRepr_create(void *ctx, BridgedArrayRef components);
185-
void *GenericIdentTypeRepr_create(void *ctx, BridgedIdentifier name, void *nameLoc, BridgedArrayRef genericArgs, void *lAngle, void *rAngle);
186-
void *CompositionTypeRepr_create(void *ctx, BridgedArrayRef types, void *firstTypeLoc);
187-
void *FunctionTypeRepr_create(void *ctx, void *argsTy, void *_Nullable asyncLoc, void *_Nullable throwsLoc, void *arrowLoc, void *returnType);
193+
void *GenericIdentTypeRepr_create(void *ctx, BridgedIdentifier name,
194+
void *nameLoc, BridgedArrayRef genericArgs,
195+
void *lAngle, void *rAngle);
196+
void *CompositionTypeRepr_create(void *ctx, BridgedArrayRef types,
197+
void *firstTypeLoc);
198+
void *FunctionTypeRepr_create(void *ctx, void *argsTy, void *_Nullable asyncLoc,
199+
void *_Nullable throwsLoc, void *arrowLoc,
200+
void *returnType);
188201
void *NamedOpaqueReturnTypeRepr_create(void *ctx, void *baseTy);
189202
void *OpaqueReturnTypeRepr_create(void *ctx, void *opaqueLoc, void *baseTy);
190203
void *ExistentialTypeRepr_create(void *ctx, void *anyLoc, void *baseTy);
191-
void *GenericParamList_create(void *ctx, void *lAngleLoc, BridgedArrayRef params, void *_Nullable whereLoc, BridgedArrayRef reqs, void *rAngleLoc);
192-
void *GenericTypeParamDecl_create(void *ctx, void *declContext, BridgedIdentifier name, void *nameLoc, void *_Nullable ellipsisLoc, long index, _Bool isParameterPack);
204+
void *GenericParamList_create(void *ctx, void *lAngleLoc,
205+
BridgedArrayRef params, void *_Nullable whereLoc,
206+
BridgedArrayRef reqs, void *rAngleLoc);
207+
void *GenericTypeParamDecl_create(void *ctx, void *declContext,
208+
BridgedIdentifier name, void *nameLoc,
209+
void *_Nullable ellipsisLoc, long index,
210+
_Bool isParameterPack);
193211
void GenericTypeParamDecl_setInheritedType(void *ctx, void *Param, void *ty);
194212

195-
struct DeclContextAndDecl TypeAliasDecl_create(void *ctx, void *declContext, void *aliasLoc, void *equalLoc, BridgedIdentifier name, void *nameLoc, void *_Nullable genericParams);
213+
struct DeclContextAndDecl TypeAliasDecl_create(void *ctx, void *declContext,
214+
void *aliasLoc, void *equalLoc,
215+
BridgedIdentifier name,
216+
void *nameLoc,
217+
void *_Nullable genericParams);
196218
void TypeAliasDecl_setUnderlyingTypeRepr(void *decl, void *underlyingType);
197219

198-
199220
void TopLevelCodeDecl_dump(void *);
200221
void Expr_dump(void *);
201222
void Decl_dump(void *);

0 commit comments

Comments
 (0)