Skip to content

Commit 1af1cbf

Browse files
committed
[gardening] Add a bunch of end namespace comments found by clang-tidy.
1 parent a9f737c commit 1af1cbf

30 files changed

+36
-36
lines changed

Diff for: lib/AST/ASTContext.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace {
7474
Import = 1 << 0,
7575
Framework = 1 << 1
7676
};
77-
}
77+
} // end anonymous namespace
7878

7979
using AssociativityCacheType =
8080
llvm::DenseMap<std::pair<PrecedenceGroupDecl *, PrecedenceGroupDecl *>,

Diff for: lib/AST/ASTDumper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3050,7 +3050,7 @@ namespace {
30503050

30513051
#undef TRIVIAL_TYPE_PRINTER
30523052
};
3053-
}
3053+
} // end anonymous namespace
30543054

30553055
void Type::dump() const {
30563056
// Make sure to print type variables.

Diff for: lib/AST/ASTMangler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ namespace {
922922
#define PATTERN(ID, BASE)
923923
#include "swift/AST/PatternNodes.def"
924924
};
925-
}
925+
} // end anonymous namespace
926926

927927
/// Find the first identifier bound by the given binding. This
928928
/// assumes that field and global-variable bindings always bind at

Diff for: lib/AST/ASTPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ hasMergeGroup(MergeGroupKind Kind) {
430430
}
431431
return false;
432432
}
433-
}
433+
} // end anonymous namespace
434434

435435
PrintOptions PrintOptions::printTypeInterface(Type T) {
436436
PrintOptions result = printInterface();

Diff for: lib/AST/ASTVerifier.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2753,7 +2753,7 @@ struct ASTNodeBase {};
27532753
}
27542754
}
27552755
};
2756-
}
2756+
} // end anonymous namespace
27572757

27582758
void swift::verify(SourceFile &SF) {
27592759
#if !(defined(NDEBUG) || defined(SWIFT_DISABLE_AST_VERIFIER))

Diff for: lib/AST/Availability.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class AvailabilityInferenceTypeWalker : public TypeWalker {
196196
return Action::Continue;
197197
}
198198
};
199-
};
199+
} // end anonymous namespace
200200

201201

202202
AvailabilityContext AvailabilityInference::inferForType(Type t) {

Diff for: lib/AST/Builtins.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ namespace {
554554
}
555555
};
556556
};
557-
}
557+
} // end anonymous namespace
558558

559559
static GenericSignatureBuilder::ConcreteGenerator
560560
makeConcrete(Type type) {

Diff for: lib/AST/ConformanceLookupTable.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ namespace {
432432
return;
433433
}
434434
}
435-
}
435+
} // end anonymous namespace
436436

437437
bool ConformanceLookupTable::addProtocol(NominalTypeDecl *nominal,
438438
ProtocolDecl *protocol, SourceLoc loc,

Diff for: lib/AST/DiagnosticEngine.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ enum LocalDiagID : uint32_t {
6767
#include "swift/AST/DiagnosticsAll.def"
6868
NumDiags
6969
};
70-
}
70+
} // end anonymous namespace
7171

7272
// TODO: categorization
7373
static StoredDiagnosticInfo storedDiagnosticInfos[] = {

Diff for: lib/AST/DiagnosticList.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ namespace swift {
2929
#define DIAG(KIND,ID,Options,Text,Signature) \
3030
detail::DiagWithArguments<void Signature>::type ID = { DiagID::ID };
3131
#include "swift/AST/DiagnosticsAll.def"
32-
}
33-
}
32+
} // end namespace diag
33+
} // end namespace swift

Diff for: lib/AST/Expr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace {
111111
return { E->getStartLoc(), E->getEndLoc() };
112112
}
113113
};
114-
}
114+
} // end anonymous namespace
115115

116116
template <class T> static SourceRange getSourceRangeImpl(const T *E) {
117117
static_assert(isOverriddenFromExpr(&T::getSourceRange) ||

Diff for: lib/AST/LookupVisibleDecls.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static void doDynamicLookup(VisibleDeclConsumer &Consumer,
381381

382382
namespace {
383383
typedef llvm::SmallPtrSet<TypeDecl *, 8> VisitedSet;
384-
}
384+
} // end anonymous namespace
385385

386386
static DeclVisibilityKind getReasonForSuper(DeclVisibilityKind Reason) {
387387
switch (Reason) {

Diff for: lib/AST/Mangle.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace {
5656
return (out << '_');
5757
}
5858
};
59-
}
59+
} // end anonymous namespace
6060

6161
// Translates operator fixity to demangler operators.
6262
static Demangle::OperatorKind TranslateOperator(OperatorFixity fixity) {

Diff for: lib/AST/Module.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ namespace {
874874
return container.lookupPrecedenceGroup(name);
875875
}
876876
};
877-
}
877+
} // end anonymous namespace
878878

879879
/// A helper class to sneak around C++ access control rules.
880880
class SourceFile::Impl {

Diff for: lib/AST/NameLookup.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ enum class DiscriminatorMatch {
337337
Matches,
338338
Different
339339
};
340-
}
340+
} // end anonymous namespace
341341

342342
static DiscriminatorMatch matchDiscriminator(Identifier discriminator,
343343
const ValueDecl *value) {
@@ -1054,7 +1054,7 @@ namespace {
10541054
/// The set of methods with the given selector.
10551055
llvm::TinyPtrVector<AbstractFunctionDecl *> Methods;
10561056
};
1057-
}
1057+
} // end anonymous namespace
10581058

10591059
/// Class member lookup table, which is a member lookup table with a second
10601060
/// table for lookup based on Objective-C selector.

Diff for: lib/AST/Pattern.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ namespace {
135135
return P;
136136
}
137137
};
138-
}
138+
} // end anonymous namespace
139139

140140

141141
/// \brief apply the specified function to all variables referenced in this

Diff for: lib/AST/PrettyStackTrace.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ namespace {
165165
return type->getDecl();
166166
}
167167
};
168-
}
168+
} // end anonymous namespace
169169

170170
void PrettyStackTraceType::print(llvm::raw_ostream &out) const {
171171
out << "While " << Action << ' ';

Diff for: lib/AST/SourceEntityWalker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class SemaAnnotator : public ASTWalker {
7878
}
7979
};
8080

81-
}
81+
} // end anonymous namespace
8282

8383
bool SemaAnnotator::walkToDeclPre(Decl *D) {
8484
if (isDone())

Diff for: lib/AST/Stmt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ namespace {
8181
return { S->getStartLoc(), S->getEndLoc() };
8282
}
8383
};
84-
}
84+
} // end anonymous namespace
8585

8686
template <class T> static SourceRange getSourceRangeImpl(const T *S) {
8787
static_assert(isOverriddenFromStmt(&T::getSourceRange) ||

Diff for: lib/AST/Type.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2587,7 +2587,7 @@ namespace {
25872587
return X.str() < Y.str();
25882588
}
25892589
};
2590-
}
2590+
} // end anonymous namespace
25912591

25922592
void ArchetypeType::populateNestedTypes() const {
25932593
if (ArchetypeTypeBits.ExpandedNestedTypes) return;

Diff for: lib/AST/TypeRepr.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace {
121121
TypeRepr *visit##CLASS##TypeRepr(CLASS##TypeRepr* type);
122122
#include "swift/AST/TypeReprNodes.def"
123123
};
124-
}
124+
} // end anonymous namespace
125125

126126
TypeRepr *CloneVisitor::visitErrorTypeRepr(ErrorTypeRepr *T) {
127127
return new (Ctx) ErrorTypeRepr(T->getSourceRange());

Diff for: lib/Basic/Demangler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,6 @@ NodePointer Demangler::demangleValueWitness() {
15251525
return addChild(VW, popNode(Node::Kind::Type));
15261526
}
15271527

1528-
} // namespace NewMangler
1529-
} // namespace swift
1528+
} // end namespace NewMangler
1529+
} // end namespace swift
15301530

Diff for: lib/Basic/FileSystem.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace {
2727
llvm::sys::Process::SafelyCloseFileDescriptor(fd);
2828
}
2929
};
30-
}
30+
} // end anonymous namespace
3131

3232
std::error_code swift::moveFileIfDifferent(const llvm::Twine &source,
3333
const llvm::Twine &destination) {

Diff for: lib/Basic/Remangle.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ namespace {
151151
}
152152
}
153153
};
154-
}
154+
} // end anonymous namespace
155155

156156
static size_t deepHash(Node *node) {
157157
DeepHasher hasher;
@@ -302,7 +302,7 @@ namespace {
302302
void mangleDependentGenericParamIndex(Node *node);
303303
void mangleConstrainedType(Node *node);
304304
};
305-
}
305+
} // end anonymous namespace
306306

307307
#define NODE(ID)
308308
#define CONTEXT_NODE(ID) \

Diff for: lib/Basic/StringExtras.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ static bool isVacuousPreposition(StringRef beforePreposition,
996996

997997
namespace {
998998
typedef std::reverse_iterator<camel_case::WordIterator> ReverseWordIterator;
999-
}
999+
} // end anonymous namespace
10001000

10011001
/// Find the last preposition in the given word.
10021002
static ReverseWordIterator findLastPreposition(ReverseWordIterator first,

Diff for: lib/ClangImporter/CFTypeInfo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace {
3939
(lhs.size() == rhs.size() && lhs < rhs));
4040
}
4141
};
42-
}
42+
} // end anonymous namespace
4343

4444
template <size_t Len>
4545
static constexpr size_t string_lengthof(const char (&data)[Len]) {

Diff for: lib/ClangImporter/ClangDiagnosticConsumer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace {
7171
{}, SM, {});
7272
}
7373
};
74-
}
74+
} // end anonymous namespace
7575

7676
ClangDiagnosticConsumer::ClangDiagnosticConsumer(
7777
ClangImporter::Implementation &impl,

Diff for: lib/ClangImporter/ClangImporter.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ namespace {
165165
return MemoryBuffer_Malloc;
166166
}
167167
};
168-
}
168+
} // end anonymous namespace
169169

170170
namespace {
171171
class BridgingPPTracker : public clang::PPCallbacks {
@@ -234,7 +234,7 @@ class BridgingPPTracker : public clang::PPCallbacks {
234234
Impl.BridgeHeaderMacros.push_back(MacroNameTok.getIdentifierInfo());
235235
}
236236
};
237-
}
237+
} // end anonymous namespace
238238

239239
void ClangImporter::Implementation::addBridgeHeaderTopLevelDecls(
240240
clang::Decl *D) {

Diff for: lib/ClangImporter/IAMInference.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ class IAMInference {
497497
return {};
498498
}
499499
};
500-
}
500+
} // end anonymous namespace
501501

502502
static StringRef getTypeName(clang::QualType qt) {
503503
if (auto typedefTy = qt->getAs<clang::TypedefType>()) {

Diff for: lib/ClangImporter/ImportDecl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ namespace inferred_attributes {
6363
enum {
6464
requires_stored_property_inits = 0x01
6565
};
66-
}
67-
}
66+
} // end namespace inferred_attributes
67+
} // end namespace swift
6868

6969
namespace {
7070
enum class MakeStructRawValuedFlags {

0 commit comments

Comments
 (0)