Skip to content

[gardening] Use consistent headers. Use consistent end of namespace comments. #8893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/AST/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ struct RequirementPrintLocation {
/// Whether the requirement needs to be in a where clause.
bool InWhereClause;
};
} // namespace
} // end anonymous namespace

/// Heuristically work out a good place for \c req to be printed inside \c
/// proto.
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/GenericSignature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ namespace {

template<typename T>
using GSBConstraint = GenericSignatureBuilder::Constraint<T>;
} // namespace
} // end anonymous namespace

/// Retrieve the best requirement source from the list
static const RequirementSource *
Expand Down
10 changes: 5 additions & 5 deletions lib/AST/GenericSignatureBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ namespace {
}
}
};
} // namespace
} // end anonymous namespace

// Give a nested type the appropriately resolved concrete type, based off a
// parent PA that has a concrete type.
Expand Down Expand Up @@ -3534,7 +3534,7 @@ namespace {

return representativeConstraint;
}
} // namespace
} // end anonymous namespace

void
GenericSignatureBuilder::finalize(SourceLoc loc,
Expand Down Expand Up @@ -3920,7 +3920,7 @@ namespace {
assert(!constraints.empty() && "All constraints were self-derived!");
return anyDerivedViaConcrete;
}
} // namespace
} // end anonymous namespace

template<typename T, typename DiagT>
Constraint<T> GenericSignatureBuilder::checkConstraintList(
Expand Down Expand Up @@ -4255,7 +4255,7 @@ namespace {
return lhs.constraint < rhs.constraint;
}
};
} // namespace
} // end anonymous namespace

void GenericSignatureBuilder::checkSameTypeConstraints(
ArrayRef<GenericTypeParamType *> genericParams,
Expand Down Expand Up @@ -4659,7 +4659,7 @@ namespace {
}
return bestSource;
}
} // namespace
} // end anonymous namespace

void GenericSignatureBuilder::enumerateRequirements(llvm::function_ref<
void (RequirementKind kind,
Expand Down
2 changes: 1 addition & 1 deletion lib/AST/ProtocolConformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ namespace {
out << "\n";
}
};
} // namespace
} // end anonymous namespace

bool NormalProtocolConformance::hasTypeWitness(AssociatedTypeDecl *assocType,
LazyResolver *resolver) const {
Expand Down
2 changes: 1 addition & 1 deletion lib/IDE/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ class ClangFileRewriterHelper {
RewriteBuf.write(OS);
}
};
} // namespace
} // end anonymous namespace
struct swift::ide::SourceEditOutputConsumer::Implementation {
ClangFileRewriterHelper Rewriter;
Implementation(SourceManager &SM, unsigned BufferId, llvm::raw_ostream &OS)
Expand Down
2 changes: 1 addition & 1 deletion lib/Immediate/REPL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class PrettyStackTraceREPL : public llvm::PrettyStackTraceEntry {

void print(llvm::raw_ostream &out) const override;
};
} // namespace
} // end anonymous namespace

/// EditLine wrapper that implements the user interface behavior for reading
/// user input to the REPL. All of its methods must be usable from a separate
Expand Down
2 changes: 1 addition & 1 deletion lib/Migrator/EditorAdapter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- EditorAdapter.cpp --------------------------------------*- C++ -*-===//
//===--- EditorAdapter.cpp ------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/Migrator/RewriteBufferEditsReceiver.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//===--- RewriteBufferEditsReceiver.cpp -------------------------*- C++ -*-===//
//===--- RewriteBufferEditsReceiver.cpp -----------------------------------===//
//
// This source file is part of the Swift.org open source project
//
Expand Down
2 changes: 1 addition & 1 deletion lib/SILGen/SILGenType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class SILGenVTable : public SILVTableVisitor<SILGenVTable> {
}
};

} // namespace
} // end anonymous namespace

static void emitTypeMemberGlobalVariable(SILGenModule &SGM,
VarDecl *var) {
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/AddressLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ class ApplyRewriter {
SILValue materializeIndirectResultAddress(SILInstruction *origDirectResultVal,
SILType argTy);
};
} // namespace
} // end anonymous namespace

/// Rewrite any indirect parameter in place.
void ApplyRewriter::rewriteParameters() {
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/RawSyntax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void dumpSyntaxKind(llvm::raw_ostream &OS, const SyntaxKind Kind) {
case SyntaxKind::Token: OS << "Token"; break;
}
}
} // namespace
} // end anonymous namespace

void RawSyntax::print(llvm::raw_ostream &OS) const {
if (const auto Tok = dyn_cast<TokenSyntax>(this)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Syntax/Trivia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void escapeNewlines(std::string &S) {
Index += 3;
}
}
} // namespace
} // end anonymous namespace

void TriviaPiece::dump(llvm::raw_ostream &OS, unsigned Indent) const {
printRepeated(OS, ' ', Indent);
Expand Down
2 changes: 1 addition & 1 deletion lib/TBDGen/TBDGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class TBDGenVisitor : public ASTVisitor<TBDGenVisitor> {

void visitDecl(Decl *D) { visitMembers(D); }
};
} // namespace
} // end anonymous namespace

static bool isGlobalOrStaticVar(VarDecl *VD) {
return VD->isStatic() || VD->getDeclContext()->isModuleScopeContext();
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/Support/Concurrency-libdispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct ExecuteOnLargeStackInfo {
Block_release(BlockToRun);
}
};
} // namespace
} // end anonymous namespace

static void executeBlock(void *Data) {
auto ExecuteInfo = (ExecuteOnLargeStackInfo*)Data;
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/Support/UIDRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UIDRegistryImpl {
static void setTag(void *Ptr, void *Tag);
static void *getTag(void *Ptr);
};
} // namespace
} // end anonymous namespace

static UIDRegistryImpl *getGlobalRegistry() {
static UIDRegistryImpl *GlobalRegistry = 0;
Expand Down
8 changes: 4 additions & 4 deletions tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ struct SourceTextInfo {
std::vector<TextReference> References;
};

} // namespace
} // end anonymous namespace

static void initDocGenericParams(const Decl *D, DocEntityInfo &Info) {
auto *DC = dyn_cast<DeclContext>(D);
Expand Down Expand Up @@ -760,7 +760,7 @@ class DocSyntaxWalker : public SyntaxModelWalker {
}
}
};
} // namespace
} // end anonymous namespace

static bool makeParserAST(CompilerInstance &CI, StringRef Text) {
CompilerInvocation Invocation;
Expand Down Expand Up @@ -894,7 +894,7 @@ class FuncWalker : public ASTWalker {
return false; // skip body.
}
};
} // namespace
} // end anonymous namespace

static void addParameterEntities(CompilerInstance &CI,
SourceTextInfo &IFaceInfo) {
Expand Down Expand Up @@ -1055,7 +1055,7 @@ class SourceDocASTWalker : public SourceEntityWalker {
return TextRange{ Start, End-Start };
}
};
} // namespace
} // end anonymous namespace

static bool getSourceTextInfo(CompilerInstance &CI,
SourceTextInfo &Info) {
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/SwiftLang/SwiftEditorInterfaceGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class DocSyntaxWalker : public SyntaxModelWalker {
}
};

} // namespace
} // end anonymous namespace

static bool makeParserAST(CompilerInstance &CI, StringRef Text) {
CompilerInvocation Invocation;
Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/SwiftLang/SwiftSourceDocInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ class RelatedIdScanner : public SourceEntityWalker {
}
};

} // namespace
} // end anonymous namespace

void SwiftLangSupport::findRelatedIdentifiersInFile(
StringRef InputFile, unsigned Offset,
Expand Down
4 changes: 2 additions & 2 deletions tools/SourceKit/tools/complete-test/complete-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct TestOptions {
bool structureOutput = false;
ArrayRef<const char *> compilerArgs;
};
} // namespace
} // end anonymous namespace
static int handleTestInvocation(TestOptions &options);

static sourcekitd_uid_t KeyRequest;
Expand Down Expand Up @@ -548,7 +548,7 @@ class ResponsePrinter {
return OS;
}
};
} // namespace
} // end anonymous namespace

static void printResponse(sourcekitd_response_t resp, bool raw, bool structure,
unsigned indentation) {
Expand Down
4 changes: 2 additions & 2 deletions tools/SourceKit/tools/sourcekitd-repl/sourcekitd-repl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static void convertToUTF8(llvm::ArrayRef<wchar_t> wide,
(void)res;
out.set_size(utf8_begin - out.begin());
}
} // namespace
} // end anonymous namespace

/// An arbitrary, otherwise-unused char value that editline interprets as
/// entering/leaving "literal mode", meaning it passes prompt characters through
Expand Down Expand Up @@ -560,7 +560,7 @@ class REPLInput {
}

};
} // namespace
} // end anonymous namespace

static bool handleRequest(StringRef Req, std::string &Error);

Expand Down
2 changes: 1 addition & 1 deletion tools/SourceKit/tools/sourcekitd-test/sourcekitd-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ struct AsyncResponseInfo {
std::string sourceFilename;
std::unique_ptr<llvm::MemoryBuffer> sourceBuffer;
};
} // namespace
} // end anonymous namespace

static std::vector<AsyncResponseInfo> asyncResponses;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class CodeCompletionResultsArray {
}
};

} // namespace
} // end anonymous namespace

VariantFunctions *
sourcekitd::getVariantFunctionsForCodeCompletionResultsArray() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct Node {
SmallVector<Element, 4> elements;
SmallVector<unsigned, 4> childIndices;
};
} // namespace
} // end anonymous namespace

struct DocStructureArrayBuilder::Implementation {
typedef CompactArrayBuilder<StringRef> InheritedTypesBuilder;
Expand Down Expand Up @@ -342,7 +342,7 @@ class DocStructureArrayReader {
>
StructureReader;
};
} // namespace
} // end anonymous namespace

DocStructureArrayReader::DocStructureArrayReader(void *buffer)
: buffer(buffer) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DocSupportAnnotationArray {
}
};

} // namespace
} // end anonymous namespace

VariantFunctions *
sourcekitd::getVariantFunctionsForDocSupportAnnotationArray() {
Expand Down
8 changes: 4 additions & 4 deletions tools/SourceKit/tools/sourcekitd/lib/API/Requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ class SKIndexingConsumer : public IndexingConsumer {

bool finishSourceEntity(UIdent Kind) override;
};
} // namespace
} // end anonymous namespace

static sourcekitd_response_t indexSource(StringRef Filename,
ArrayRef<const char *> Args,
Expand Down Expand Up @@ -1114,7 +1114,7 @@ class SKDocConsumer : public DocInfoConsumer {

bool handleDiagnostic(const DiagnosticEntryInfo &Info) override;
};
} // namespace
} // end anonymous namespace

static bool isSwiftPrefixed(StringRef MangledName) {
if (MangledName.size() < 2)
Expand Down Expand Up @@ -1563,7 +1563,7 @@ class SKCodeCompletionConsumer : public CodeCompletionConsumer {

bool handleResult(const CodeCompletionInfo &Info) override;
};
} // namespace
} // end anonymous namespace

static sourcekitd_response_t codeComplete(llvm::MemoryBuffer *InputBuf,
int64_t Offset,
Expand Down Expand Up @@ -1940,7 +1940,7 @@ class SKEditorConsumer : public EditorConsumer {
}
};

} // namespace
} // end anonymous namespace

static sourcekitd_response_t
editorOpen(StringRef Name, llvm::MemoryBuffer *Buf, bool EnableSyntaxMap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class TokenAnnotationsArray {
}
};

} // namespace
} // end anonymous namespace

namespace sourcekitd {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ class VariantPrinter : public VariantVisitor<VariantPrinter>,
VariantPrinter(raw_ostream &OS, unsigned Indent = 0, bool PrintAsJSON = false)
: RequestResponsePrinterBase(OS, Indent, PrintAsJSON) { }
};
} // namespace
} // end anonymous namespace

void sourcekitd::writeEscaped(llvm::StringRef Str, llvm::raw_ostream &OS) {
for (unsigned i = 0, e = Str.size(); i != e; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion tools/sil-opt/SILOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ enum EnforceExclusivityMode {
DynamicOnly,
None
};
} // namespace
} // end anonymous namespace

static cl::opt<EnforceExclusivityMode> EnforceExclusivity(
"enforce-exclusivity", cl::desc("Enforce law of exclusivity "
Expand Down
2 changes: 1 addition & 1 deletion unittests/Syntax/ExprSyntaxTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ FunctionCallArgumentListSyntax getLabellessArgumentList() {
.appending(ThreeArg)
.castTo<FunctionCallArgumentListSyntax>();
}
} // namespace
} // end anonymous namespace

TEST(ExprSyntaxTests, FunctionCallArgumentListGetAPIs) {
auto X = SyntaxFactory::makeIdentifier("x", {}, {});
Expand Down