Skip to content

Commit 8845845

Browse files
committed
clang format
1 parent 1715ebc commit 8845845

File tree

1 file changed

+38
-42
lines changed

1 file changed

+38
-42
lines changed

lib/Sema/DerivedConformances.h

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,14 @@ class DerivedConformance {
133133
///
134134
/// \returns True if the requirement can be derived.
135135
static bool canDeriveComparable(DeclContext *DC, EnumDecl *enumeration);
136-
136+
137137
/// Derive an Equatable requirement for a type.
138138
///
139139
/// This is implemented for enums without associated or raw values.
140140
///
141141
/// \returns the derived member, which will also be added to the type.
142142
ValueDecl *deriveComparable(ValueDecl *requirement);
143-
143+
144144
/// Determine if an Equatable requirement can be derived for a type.
145145
///
146146
/// This is implemented for enums without associated values or all-Equatable
@@ -232,42 +232,42 @@ class DerivedConformance {
232232
///
233233
/// \param synthesizing The decl that is being synthesized.
234234
bool checkAndDiagnoseDisallowedContext(ValueDecl *synthesizing) const;
235-
235+
236236
/// Returns a generated guard statement that checks whether the given lhs and
237237
/// rhs expressions are equal. If not equal, the else block for the guard
238238
/// returns `guardReturnValue`.
239239
/// \p C The AST context.
240240
/// \p lhsExpr The first expression to compare for equality.
241241
/// \p rhsExpr The second expression to compare for equality.
242-
/// \p guardReturnValue The expression to return if the two sides are not equal
243-
static
244-
GuardStmt *returnIfNotEqualGuard(ASTContext &C, Expr *lhsExpr, Expr *rhsExpr,
245-
Expr *guardReturnValue);
246-
// return false
247-
static
248-
GuardStmt *returnFalseIfNotEqualGuard(ASTContext &C, Expr *lhsExpr, Expr *rhsExpr);
242+
/// \p guardReturnValue The expression to return if the two sides are not
243+
/// equal
244+
static GuardStmt *returnIfNotEqualGuard(ASTContext &C, Expr *lhsExpr,
245+
Expr *rhsExpr,
246+
Expr *guardReturnValue);
247+
// return false
248+
static GuardStmt *returnFalseIfNotEqualGuard(ASTContext &C, Expr *lhsExpr,
249+
Expr *rhsExpr);
249250
// return lhs < rhs
250-
static
251-
GuardStmt *returnComparisonIfNotEqualGuard(ASTContext &C, Expr *lhsExpr, Expr *rhsExpr);
252-
253-
/// Returns the ParamDecl for each associated value of the given enum whose type
254-
/// does not conform to a protocol
255-
/// \p theEnum The enum whose elements and associated values should be checked.
256-
/// \p protocol The protocol being requested.
257-
/// \return The ParamDecl of each associated value whose type does not conform.
251+
static GuardStmt *
252+
returnComparisonIfNotEqualGuard(ASTContext &C, Expr *lhsExpr, Expr *rhsExpr);
253+
254+
/// Returns the ParamDecl for each associated value of the given enum whose
255+
/// type does not conform to a protocol \p theEnum The enum whose elements and
256+
/// associated values should be checked. \p protocol The protocol being
257+
/// requested. \return The ParamDecl of each associated value whose type does
258+
/// not conform.
258259
static SmallVector<ParamDecl *, 3>
259260
associatedValuesNotConformingToProtocol(DeclContext *DC, EnumDecl *theEnum,
260-
ProtocolDecl *protocol);
261+
ProtocolDecl *protocol);
261262

262263
/// Returns true if, for every element of the given enum, it either has no
263264
/// associated values or all of them conform to a protocol.
264-
/// \p theEnum The enum whose elements and associated values should be checked.
265-
/// \p protocol The protocol being requested.
266-
/// \return True if all associated values of all elements of the enum conform.
267-
static bool
268-
allAssociatedValuesConformToProtocol(DeclContext *DC,
269-
EnumDecl *theEnum,
270-
ProtocolDecl *protocol);
265+
/// \p theEnum The enum whose elements and associated values should be
266+
/// checked. \p protocol The protocol being requested. \return True if all
267+
/// associated values of all elements of the enum conform.
268+
static bool allAssociatedValuesConformToProtocol(DeclContext *DC,
269+
EnumDecl *theEnum,
270+
ProtocolDecl *protocol);
271271
/// Create AST statements which convert from an enum to an Int with a switch.
272272
/// \p stmts The generated statements are appended to this vector.
273273
/// \p parentDC Either an extension or the enum itself.
@@ -277,22 +277,18 @@ class DerivedConformance {
277277
/// \p indexName The name of the output variable.
278278
/// \return A DeclRefExpr of the output variable (of type Int).
279279
static DeclRefExpr *
280-
convertEnumToIndex( SmallVectorImpl<ASTNode> &stmts,
281-
DeclContext *parentDC,
282-
EnumDecl *enumDecl,
283-
VarDecl *enumVarDecl,
284-
AbstractFunctionDecl *funcDecl,
285-
const char *indexName);
286-
287-
static Pattern*
288-
enumElementPayloadSubpattern(EnumElementDecl *enumElementDecl,
289-
char varPrefix, DeclContext *varContext,
290-
SmallVectorImpl<VarDecl*> &boundVars);
291-
292-
static VarDecl *
293-
indexedVarDecl(char prefixChar, int index, Type type,
294-
DeclContext *varContext);
280+
convertEnumToIndex(SmallVectorImpl<ASTNode> &stmts, DeclContext *parentDC,
281+
EnumDecl *enumDecl, VarDecl *enumVarDecl,
282+
AbstractFunctionDecl *funcDecl, const char *indexName);
283+
284+
static Pattern *
285+
enumElementPayloadSubpattern(EnumElementDecl *enumElementDecl, char varPrefix,
286+
DeclContext *varContext,
287+
SmallVectorImpl<VarDecl *> &boundVars);
288+
289+
static VarDecl *indexedVarDecl(char prefixChar, int index, Type type,
290+
DeclContext *varContext);
295291
};
296-
}
292+
} // namespace swift
297293

298294
#endif

0 commit comments

Comments
 (0)