Skip to content

Commit f030142

Browse files
committed
Fix messed up indentation in TypeCheckMacros.cpp
1 parent 373bc85 commit f030142

File tree

6 files changed

+181
-194
lines changed

6 files changed

+181
-194
lines changed

lib/AST/Module.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,11 @@ void SourceLookupCache::addToUnqualifiedLookupCache(Range decls,
242242
}
243243
}
244244

245-
else if (auto *NTD = dyn_cast<NominalTypeDecl>(D)) {
245+
if (auto *NTD = dyn_cast<NominalTypeDecl>(D))
246246
if (!NTD->hasUnparsedMembers() || NTD->maybeHasOperatorDeclarations())
247247
addToUnqualifiedLookupCache(NTD->getMembers(), true);
248-
}
249248

250-
else if (auto *ED = dyn_cast<ExtensionDecl>(D)) {
249+
if (auto *ED = dyn_cast<ExtensionDecl>(D)) {
251250
// Avoid populating the cache with the members of invalid extension
252251
// declarations. These members can be used to point validation inside of
253252
// a malformed context.
@@ -257,13 +256,13 @@ void SourceLookupCache::addToUnqualifiedLookupCache(Range decls,
257256
addToUnqualifiedLookupCache(ED->getMembers(), true);
258257
}
259258

260-
else if (auto *OD = dyn_cast<OperatorDecl>(D))
259+
if (auto *OD = dyn_cast<OperatorDecl>(D))
261260
Operators[OD->getName()].push_back(OD);
262261

263262
else if (auto *PG = dyn_cast<PrecedenceGroupDecl>(D))
264263
PrecedenceGroups[PG->getName()].push_back(PG);
265264

266-
else if (auto *MED = dyn_cast<MacroExpansionDecl>(D))
265+
if (auto *MED = dyn_cast<MacroExpansionDecl>(D))
267266
DelayedMacroExpansions.push_back(MED);
268267
}
269268
}

lib/AST/NameLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ QualifiedLookupRequest::evaluate(Evaluator &eval, const DeclContext *DC,
20012001
};
20022002

20032003
// Add all of the nominal types to the stack.
2004-
for (auto nominal: typeDecls) {
2004+
for (auto nominal : typeDecls) {
20052005
addNominalType(nominal);
20062006
}
20072007

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,7 @@ static Optional<MacroRole> getMacroRole(
21912191
auto role = llvm::StringSwitch<Optional<MacroRole>>(roleName->str())
21922192
.Case("declaration", MacroRole::Declaration)
21932193
.Case("expression", MacroRole::Expression)
2194+
.Case("codeItem", MacroRole::CodeItem)
21942195
.Case("accessor", MacroRole::Accessor)
21952196
.Case("memberAttributes", MacroRole::MemberAttribute)
21962197
.Case("synthesizedMembers", MacroRole::SynthesizedMembers)
@@ -4768,7 +4769,7 @@ bool Parser::isStartOfSwiftDecl(bool allowPoundIfAttributes) {
47684769
// Skip a #if that contains only attributes in all branches. These will be
47694770
// parsed as attributes of a declaration, not as separate declarations.
47704771
if (Tok.is(tok::pound_if) && allowPoundIfAttributes) {
4771-
BacktrackingScope backtrack(*this);
4772+
BacktrackingScope backtrack(*this);
47724773
bool sawAnyAttributes = false;
47734774
return skipIfConfigOfAttributes(sawAnyAttributes) &&
47744775
(Tok.is(tok::eof) || (sawAnyAttributes && isStartOfSwiftDecl()));

0 commit comments

Comments
 (0)