diff options
author | Alexander Kornienko <alexfh@google.com> | 2015-06-22 23:07:51 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2015-06-22 23:07:51 +0000 |
commit | 8ca7705aa3e5a2e0f39d00aaa170827369ec9784 (patch) | |
tree | 2a33ddff0e4b77ce71382ca30a2f6ed5875a4cff /lib | |
parent | 4dcc0f7da78882b0946f6f46ec6397dd566b4e72 (diff) | |
download | clang-8ca7705aa3e5a2e0f39d00aaa170827369ec9784.tar.gz |
Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
169 files changed, 368 insertions, 378 deletions
diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 81d1a283f0..8c2e0f4de8 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -177,7 +177,7 @@ protected: } }; -} // namespace +} ObjCMigrateAction::ObjCMigrateAction(FrontendAction *WrappedAction, StringRef migrateDir, @@ -379,7 +379,7 @@ public: return true; } }; -} // namespace +} void ObjCMigrateASTConsumer::migrateDecl(Decl *D) { if (!D) @@ -1853,7 +1853,7 @@ private: } }; -} // namespace +} void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { @@ -2084,7 +2084,7 @@ template<> struct DenseMapInfo<EditEntry> { LHS.Text == RHS.Text; } }; -} // namespace llvm +} namespace { class RemapFileParser { @@ -2166,7 +2166,7 @@ private: Entries.push_back(Entry); } }; -} // namespace +} static bool reportDiag(const Twine &Err, DiagnosticsEngine &Diag) { Diag.Report(Diag.getCustomDiagID(DiagnosticsEngine::Error, "%0")) diff --git a/lib/ARCMigrate/TransAutoreleasePool.cpp b/lib/ARCMigrate/TransAutoreleasePool.cpp index 8e944110af..a8a99fa712 100644 --- a/lib/ARCMigrate/TransAutoreleasePool.cpp +++ b/lib/ARCMigrate/TransAutoreleasePool.cpp @@ -62,7 +62,7 @@ public: } }; -} // namespace +} namespace { diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp index dfae3f5cba..56d3af7233 100644 --- a/lib/ARCMigrate/Transforms.cpp +++ b/lib/ARCMigrate/Transforms.cpp @@ -355,7 +355,7 @@ public: } }; -} // namespace +} MigrationContext::~MigrationContext() { for (traverser_iterator diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp index 4da6240f86..0ebd377e53 100644 --- a/lib/AST/ASTDumper.cpp +++ b/lib/AST/ASTDumper.cpp @@ -550,7 +550,7 @@ namespace { void visitVerbatimBlockLineComment(const VerbatimBlockLineComment *C); void visitVerbatimLineComment(const VerbatimLineComment *C); }; -} // namespace +} //===----------------------------------------------------------------------===// // Utilities diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 3c9899aec8..76e4e11915 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -223,7 +223,7 @@ namespace clang { Expr *VisitMemberExpr(MemberExpr *E); Expr *VisitCallExpr(CallExpr *E); }; -} // namespace clang +} using namespace clang; //---------------------------------------------------------------------------- @@ -296,7 +296,7 @@ namespace { return C2.getDiagnostics().Report(Loc, DiagID); } }; -} // namespace +} static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, QualType T1, QualType T2); diff --git a/lib/AST/CXXABI.h b/lib/AST/CXXABI.h index 2dab43cea1..dad226474f 100644 --- a/lib/AST/CXXABI.h +++ b/lib/AST/CXXABI.h @@ -62,6 +62,6 @@ public: /// Creates an instance of a C++ ABI class. CXXABI *CreateItaniumCXXABI(ASTContext &Ctx); CXXABI *CreateMicrosoftCXXABI(ASTContext &Ctx); -} // namespace clang +} #endif diff --git a/lib/AST/CXXInheritance.cpp b/lib/AST/CXXInheritance.cpp index b1c5a0033b..800c8f83b8 100644 --- a/lib/AST/CXXInheritance.cpp +++ b/lib/AST/CXXInheritance.cpp @@ -470,7 +470,7 @@ namespace { const CXXRecordDecl *InVirtualSubobject, CXXFinalOverriderMap &Overriders); }; -} // namespace +} void FinalOverriderCollector::Collect(const CXXRecordDecl *RD, bool VirtualBase, diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 973d79fc5d..d9a3389c58 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1350,7 +1350,7 @@ public: return LV; } }; -} // namespace clang +} static LinkageInfo getLVForDecl(const NamedDecl *D, LVComputationKind computation) { diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index c2c590f7c0..a1600cb110 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -1259,7 +1259,7 @@ namespace { const SynthesizeIvarChunk &RHS) { return LHS.Size < RHS.Size; } -} // namespace +} /// all_declared_ivar_begin - return first ivar declared in this class, /// its extensions and its implementation. Lazily build the list on first diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 0ea946d498..c3ce476009 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -96,7 +96,7 @@ namespace { void prettyPrintAttributes(Decl *D); void printDeclType(QualType T, StringRef DeclName, bool Pack = false); }; -} // namespace +} void Decl::print(raw_ostream &Out, unsigned Indentation, bool PrintInstantiation) const { diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 8f0c57b10b..36f4139f83 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -188,7 +188,7 @@ namespace { SourceLocation (Expr::*v)() const) { return static_cast<const E*>(expr)->getLocStart(); } -} // namespace +} SourceLocation Expr::getExprLoc() const { switch (getStmtClass()) { @@ -2907,7 +2907,7 @@ namespace { HasSideEffects = true; } }; -} // namespace +} bool Expr::HasSideEffects(const ASTContext &Ctx, bool IncludePossibleEffects) const { @@ -3208,7 +3208,7 @@ namespace { NonTrivial = true; } }; -} // namespace +} bool Expr::hasNonTrivialCall(const ASTContext &Ctx) const { NonTrivialCallFinder Finder(Ctx); diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index b69bc1c795..8e472f1741 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -791,7 +791,7 @@ namespace { }; typedef ScopeRAII<false> BlockScopeRAII; typedef ScopeRAII<true> FullExpressionRAII; -} // namespace +} bool SubobjectDesignator::checkSubobject(EvalInfo &Info, const Expr *E, CheckSubobjectKind CSK) { @@ -1091,7 +1091,7 @@ namespace { return false; return LHS.Path == RHS.Path; } -} // namespace +} static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E); static bool EvaluateInPlace(APValue &Result, EvalInfo &Info, @@ -3210,7 +3210,7 @@ enum EvalStmtResult { /// Still scanning for 'case' or 'default' statement. ESR_CaseNotFound }; -} // namespace +} static bool EvaluateDecl(EvalInfo &Info, const Decl *D) { if (const VarDecl *VD = dyn_cast<VarDecl>(D)) { @@ -4314,7 +4314,7 @@ public: } }; -} // namespace +} //===----------------------------------------------------------------------===// // Common base class for lvalue and temporary evaluation. @@ -4411,7 +4411,7 @@ public: } } }; -} // namespace +} //===----------------------------------------------------------------------===// // LValue Evaluation @@ -5153,7 +5153,7 @@ namespace { bool VisitCXXConstructExpr(const CXXConstructExpr *E); bool VisitCXXStdInitializerListExpr(const CXXStdInitializerListExpr *E); }; -} // namespace +} /// Perform zero-initialization on an object of non-union class type. /// C++11 [dcl.init]p5: @@ -6645,7 +6645,7 @@ private: } }; -} // namespace +} bool DataRecursiveIntBinOpEvaluator:: VisitBinOpLHSOnly(EvalResult &LHSResult, const BinaryOperator *E, @@ -8640,7 +8640,7 @@ struct ICEDiag { ICEDiag(ICEKind IK, SourceLocation l) : Kind(IK), Loc(l) {} }; -} // namespace +} static ICEDiag NoDiag() { return ICEDiag(IK_ICE, SourceLocation()); } diff --git a/lib/AST/ItaniumCXXABI.cpp b/lib/AST/ItaniumCXXABI.cpp index 28cb6d8b36..7503cbfc98 100644 --- a/lib/AST/ItaniumCXXABI.cpp +++ b/lib/AST/ItaniumCXXABI.cpp @@ -153,7 +153,7 @@ public: return new ItaniumNumberingContext(); } }; -} // namespace +} CXXABI *clang::CreateItaniumCXXABI(ASTContext &Ctx) { return new ItaniumCXXABI(Ctx); diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 38c3ccb673..e5a31f879b 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -408,7 +408,7 @@ private: void mangleFunctionParam(const ParmVarDecl *parm); }; -} // namespace +} bool ItaniumMangleContextImpl::shouldMangleCXXName(const NamedDecl *D) { const FunctionDecl *FD = dyn_cast<FunctionDecl>(D); diff --git a/lib/AST/MicrosoftCXXABI.cpp b/lib/AST/MicrosoftCXXABI.cpp index 29229ee3c0..aba6796256 100644 --- a/lib/AST/MicrosoftCXXABI.cpp +++ b/lib/AST/MicrosoftCXXABI.cpp @@ -124,7 +124,7 @@ public: return new MicrosoftNumberingContext(); } }; -} // namespace +} // getNumBases() seems to only give us the number of direct bases, and not the // total. This function tells us if we inherit from anybody that uses MI, or if diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 01b1ed3c2d..29a95a5103 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -313,7 +313,7 @@ private: void mangleTemplateArg(const TemplateDecl *TD, const TemplateArgument &TA, const NamedDecl *Parm); }; -} // namespace +} bool MicrosoftMangleContextImpl::shouldMangleCXXName(const NamedDecl *D) { if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { diff --git a/lib/AST/NestedNameSpecifier.cpp b/lib/AST/NestedNameSpecifier.cpp index 059262109f..50a00502ca 100644 --- a/lib/AST/NestedNameSpecifier.cpp +++ b/lib/AST/NestedNameSpecifier.cpp @@ -377,7 +377,7 @@ namespace { memcpy(&Result, static_cast<char *>(Data) + Offset, sizeof(void*)); return Result; } -} // namespace +} SourceRange NestedNameSpecifierLoc::getSourceRange() const { if (!Qualifier) @@ -470,7 +470,7 @@ namespace { reinterpret_cast<char *>(&Ptr) + sizeof(void *), Buffer, BufferSize, BufferCapacity); } -} // namespace +} NestedNameSpecifierLocBuilder:: NestedNameSpecifierLocBuilder(const NestedNameSpecifierLocBuilder &Other) diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index 31baed83e9..6f4a89fee3 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -190,7 +190,7 @@ namespace { (void) is_good(implements_getLocStart(&type::getLocStart)) #define ASSERT_IMPLEMENTS_getLocEnd(type) \ (void) is_good(implements_getLocEnd(&type::getLocEnd)) -} // namespace +} /// Check whether the various Stmt classes implement their member /// functions. @@ -239,7 +239,7 @@ namespace { return SourceRange(static_cast<const S*>(stmt)->getLocStart(), static_cast<const S*>(stmt)->getLocEnd()); } -} // namespace +} SourceRange Stmt::getSourceRange() const { switch (getStmtClass()) { diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 36eb08c01c..658e3dfdee 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -104,7 +104,7 @@ namespace { void Visit##CLASS(CLASS *Node); #include "clang/AST/StmtNodes.inc" }; -} // namespace +} //===----------------------------------------------------------------------===// // Stmt printing methods. @@ -799,7 +799,7 @@ void OMPClausePrinter::VisitOMPFlushClause(OMPFlushClause *Node) { OS << ")"; } } -} // namespace +} //===----------------------------------------------------------------------===// // OpenMP directives printing methods diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index 47e161fd94..23f8d0c8be 100644 --- a/lib/AST/StmtProfile.cpp +++ b/lib/AST/StmtProfile.cpp @@ -65,7 +65,7 @@ namespace { /// \brief Visit a single template argument. void VisitTemplateArgument(const TemplateArgument &Arg); }; -} // namespace +} void StmtProfiler::VisitStmt(const Stmt *S) { ID.AddInteger(S->getStmtClass()); @@ -425,7 +425,7 @@ OMPClauseProfiler::VisitOMPCopyprivateClause(const OMPCopyprivateClause *C) { void OMPClauseProfiler::VisitOMPFlushClause(const OMPFlushClause *C) { VisitOMPClauseList(C); } -} // namespace +} void StmtProfiler::VisitOMPExecutableDirective(const OMPExecutableDirective *S) { diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 097d012082..3ac1171940 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -597,7 +597,7 @@ namespace { return Visit(T->getOriginalType()); } }; -} // namespace +} AutoType *Type::getContainedAutoType() const { return GetContainedAutoVisitor().Visit(this); @@ -2101,7 +2101,7 @@ public: L.hasLocalOrUnnamedType() | R.hasLocalOrUnnamedType()); } }; -} // namespace +} static CachedProperties computeCachedProperties(const Type *T); @@ -2143,7 +2143,7 @@ public: T->TypeBits.CachedLocalOrUnnamed = Result.hasLocalOrUnnamedType(); } }; -} // namespace clang +} // Instantiate the friend template at a private class. In a // reasonable implementation, these symbols will be internal. diff --git a/lib/AST/TypeLoc.cpp b/lib/AST/TypeLoc.cpp index f3d379ae6e..c069eb0617 100644 --- a/lib/AST/TypeLoc.cpp +++ b/lib/AST/TypeLoc.cpp @@ -33,7 +33,7 @@ namespace { } #include "clang/AST/TypeLocNodes.def" }; -} // namespace +} SourceRange TypeLoc::getLocalSourceRangeImpl(TypeLoc TL) { if (TL.isNull()) return SourceRange(); @@ -50,7 +50,7 @@ namespace { } #include "clang/AST/TypeLocNodes.def" }; -} // namespace +} /// \brief Returns the alignment of the type source info data block. unsigned TypeLoc::getLocalAlignmentForType(QualType Ty) { @@ -68,7 +68,7 @@ namespace { } #include "clang/AST/TypeLocNodes.def" }; -} // namespace +} /// \brief Returns the size of the type source info data block. unsigned TypeLoc::getFullDataSizeForType(QualType Ty) { @@ -96,7 +96,7 @@ namespace { } #include "clang/AST/TypeLocNodes.def" }; -} // namespace +} /// \brief Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the /// TypeLoc is a PointerLoc and next TypeLoc is for "int". @@ -216,7 +216,7 @@ namespace { } #include "clang/AST/TypeLocNodes.def" }; -} // namespace +} /// \brief Determines if the given type loc corresponds to a diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index a727a51fe6..ebe09d8549 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -108,7 +108,7 @@ namespace { void print##CLASS##After(const CLASS##Type *T, raw_ostream &OS); #include "clang/AST/TypeNodes.def" }; -} // namespace +} static void AppendTypeQualList(raw_ostream &OS, unsigned TypeQuals, bool C99) { bool appendSpace = false; diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index ef3e5bb0b4..ca5f0aad00 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -2237,7 +2237,7 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) { Out << '\n'; } -} // namespace +} VTableLayout::VTableLayout(uint64_t NumVTableComponents, const VTableComponent *VTableComponents, diff --git a/lib/Analysis/BodyFarm.cpp b/lib/Analysis/BodyFarm.cpp index 77bb3eaaa1..7d1b235752 100644 --- a/lib/Analysis/BodyFarm.cpp +++ b/lib/Analysis/BodyFarm.cpp @@ -84,7 +84,7 @@ public: private: ASTContext &C; }; -} // namespace +} BinaryOperator *ASTMaker::makeAssignment(const Expr *LHS, const Expr *RHS, QualType Ty) { diff --git a/lib/Analysis/BodyFarm.h b/lib/Analysis/BodyFarm.h index e5b554cb22..9137943723 100644 --- a/lib/Analysis/BodyFarm.h +++ b/lib/Analysis/BodyFarm.h @@ -46,6 +46,6 @@ private: BodyMap Bodies; CodeInjector *Injector; }; -} // namespace clang +} #endif diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp index 344146f857..91a8492eaa 100644 --- a/lib/Analysis/CallGraph.cpp +++ b/lib/Analysis/CallGraph.cpp @@ -225,4 +225,4 @@ struct DOTGraphTraits<const CallGraph*> : public DefaultDOTGraphTraits { } }; -} // namespace llvm +} diff --git a/lib/Analysis/Consumed.cpp b/lib/Analysis/Consumed.cpp index 5c892b25c0..fa985ee02e 100644 --- a/lib/Analysis/Consumed.cpp +++ b/lib/Analysis/Consumed.cpp @@ -941,8 +941,7 @@ void ConsumedStmtVisitor::VisitVarDecl(const VarDecl *Var) { StateMap->setState(Var, consumed::CS_Unknown); } } -} // namespace consumed -} // namespace clang +}} // end clang::consumed::ConsumedStmtVisitor namespace clang { namespace consumed { @@ -1468,5 +1467,4 @@ void ConsumedAnalyzer::run(AnalysisDeclContext &AC) { WarningsHandler.emitDiagnostics(); } -} // namespace consumed -} // namespace clang +}} // end namespace clang::consumed diff --git a/lib/Analysis/FormatStringParsing.h b/lib/Analysis/FormatStringParsing.h index d541521715..e1652964b8 100644 --- a/lib/Analysis/FormatStringParsing.h +++ b/lib/Analysis/FormatStringParsing.h @@ -68,7 +68,7 @@ public: const T &getValue() { return FS; } }; -} // namespace analyze_format_string -} // namespace clang +} // end analyze_format_string namespace +} // end clang namespace #endif diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 13af3beaa2..0ab158036d 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -44,7 +44,7 @@ public: void sortWorklist(); }; -} // namespace +} void DataflowWorklist::enqueueBlock(const clang::CFGBlock *block) { if (block && !enqueuedBlocks[block->getBlockID()]) { @@ -106,7 +106,7 @@ public: DSetFact(false), // This is a *major* performance win. killAtAssign(KillAtAssign) {} }; -} // namespace +} static LiveVariablesImpl &getImpl(void *x) { return *((LiveVariablesImpl *) x); @@ -135,7 +135,7 @@ namespace { } return A; } -} // namespace +} void LiveVariables::Observer::anchor() { } @@ -212,7 +212,7 @@ public: void VisitUnaryOperator(UnaryOperator *UO); void Visit(Stmt *S); }; -} // namespace +} static const VariableArrayType *FindVA(QualType Ty) { const Type *ty = Ty.getTypePtr(); diff --git a/lib/Analysis/ReachableCode.cpp b/lib/Analysis/ReachableCode.cpp index 795d6741fe..8165b09f40 100644 --- a/lib/Analysis/ReachableCode.cpp +++ b/lib/Analysis/ReachableCode.cpp @@ -370,7 +370,7 @@ namespace { const Stmt *S, clang::reachable_code::Callback &CB); }; -} // namespace +} void DeadCodeScan::enqueue(const CFGBlock *block) { unsigned blockID = block->getBlockID(); @@ -676,5 +676,4 @@ void FindUnreachableCode(AnalysisDeclContext &AC, Preprocessor &PP, } } -} // namespace reachable_code -} // namespace clang +}} // end namespace clang::reachable_code diff --git a/lib/Analysis/ThreadSafetyLogical.cpp b/lib/Analysis/ThreadSafetyLogical.cpp index 9d8456719b..facfa11a39 100644 --- a/lib/Analysis/ThreadSafetyLogical.cpp +++ b/lib/Analysis/ThreadSafetyLogical.cpp @@ -109,4 +109,4 @@ bool implies(const LExpr *LHS, const LExpr *RHS) { } } } -} // namespace clang +} diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp index df071c4481..f2f791957a 100644 --- a/lib/Analysis/UninitializedValues.cpp +++ b/lib/Analysis/UninitializedValues.cpp @@ -62,7 +62,7 @@ public: /// Returns the bit vector index for a given declaration. Optional<unsigned> getValueIndex(const VarDecl *d) const; }; -} // namespace +} void DeclToIndex::computeMap(const DeclContext &dc) { unsigned count = 0; @@ -223,7 +223,7 @@ public: void enqueueSuccessors(const CFGBlock *block); const CFGBlock *dequeue(); }; -} // namespace +} void DataflowWorklist::enqueueSuccessors(const clang::CFGBlock *block) { for (CFGBlock::const_succ_iterator I = block->succ_begin(), @@ -345,7 +345,7 @@ public: return Init; } }; -} // namespace +} static const DeclRefExpr *getSelfInitExpr(VarDecl *VD) { if (VD->getType()->isRecordType()) return nullptr; @@ -672,7 +672,7 @@ public: return Use; } }; -} // namespace +} void TransferFunctions::reportUse(const Expr *ex, const VarDecl *vd) { Value v = vals[vd]; @@ -862,7 +862,7 @@ struct PruneBlocksHandler : public UninitVariablesHandler { hadAnyUse = true; } }; -} // namespace +} void clang::runUninitializedVariablesAnalysis( const DeclContext &dc, diff --git a/lib/Basic/DiagnosticIDs.cpp b/lib/Basic/DiagnosticIDs.cpp index baee5aa8e0..643503b00b 100644 --- a/lib/Basic/DiagnosticIDs.cpp +++ b/lib/Basic/DiagnosticIDs.cpp @@ -68,7 +68,7 @@ struct StaticDiagInfoRec { } }; -} // namespace +} // namespace anonymous static const StaticDiagInfoRec StaticDiagInfo[] = { #define DIAG(ENUM, CLASS, DEFAULT_SEVERITY, DESC, GROUP, SFINAE, NOWERROR, \ @@ -193,7 +193,7 @@ namespace { return StringRef(NameStr, NameLen); } }; -} // namespace +} // Unfortunately, the split between DiagnosticIDs and Diagnostic is not // particularly clean, but for now we just implement this method here so we can @@ -292,8 +292,8 @@ namespace clang { } }; - } // namespace diag -} // namespace clang + } // end diag namespace +} // end clang namespace //===----------------------------------------------------------------------===// @@ -497,7 +497,7 @@ namespace { DiagGroupNames[NameOffset]); } }; -} // namespace +} // Second the table of options, sorted by name for fast binary lookup. static const WarningOption OptionTable[] = { diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index c7bb2c667d..b295008100 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -122,7 +122,7 @@ namespace { KS_Enabled, // Enabled KS_Future // Is a keyword in future standard }; -} // namespace +} /// \brief Translates flags as specified in TokenKinds.def into keyword status /// in the given language standard. diff --git a/lib/Basic/VirtualFileSystem.cpp b/lib/Basic/VirtualFileSystem.cpp index 7196f2d1f9..8a882e13f7 100644 --- a/lib/Basic/VirtualFileSystem.cpp +++ b/lib/Basic/VirtualFileSystem.cpp @@ -213,7 +213,7 @@ public: return EC; } }; -} // namespace +} directory_iterator RealFileSystem::dir_begin(const Twine &Dir, std::error_code &EC) { @@ -1024,7 +1024,7 @@ public: JSONWriter(llvm::raw_ostream &OS) : OS(OS) {} void write(ArrayRef<YAMLVFSEntry> Entries, Optional<bool> IsCaseSensitive); }; -} // namespace +} bool JSONWriter::containedIn(StringRef Parent, StringRef Path) { using namespace llvm::sys; diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index b133e932c4..f5edea7810 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -149,7 +149,7 @@ private: const LangOptions &LangOpts; }; -} // namespace +} static void addObjCARCAPElimPass(const PassManagerBuilder &Builder, PassManagerBase &PM) { if (Builder.OptLevel > 0) diff --git a/lib/CodeGen/CGAtomic.cpp b/lib/CodeGen/CGAtomic.cpp index 57b92dd97d..da82249fe1 100644 --- a/lib/CodeGen/CGAtomic.cpp +++ b/lib/CodeGen/CGAtomic.cpp @@ -272,7 +272,7 @@ namespace { void EmitAtomicUpdateOp(llvm::AtomicOrdering AO, RValue UpdateRal, bool IsVolatile); }; -} // namespace +} AtomicExpr::AtomicOrderingKind AtomicInfo::translateAtomicOrdering(const llvm::AtomicOrdering AO) { diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index d3a3131888..3fd344c389 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -242,7 +242,7 @@ namespace { return LeftValue > RightValue; } -} // namespace +} /// Determines if the given type is safe for constant capture in C++. static bool isSafeForCXXConstantCapture(QualType type) { @@ -2249,7 +2249,7 @@ namespace { CGF.BuildBlockRelease(Addr, BLOCK_FIELD_IS_BYREF); } }; -} // namespace +} /// Enter a cleanup to destroy a __block variable. Note that this /// cleanup should be a no-op if the variable hasn't left the stack diff --git a/lib/CodeGen/CGBlocks.h b/lib/CodeGen/CGBlocks.h index ef43d1b098..c4eed0d0e8 100644 --- a/lib/CodeGen/CGBlocks.h +++ b/lib/CodeGen/CGBlocks.h @@ -37,7 +37,7 @@ class FunctionType; class PointerType; class Value; class LLVMContext; -} // namespace llvm +} namespace clang { diff --git a/lib/CodeGen/CGCUDANV.cpp b/lib/CodeGen/CGCUDANV.cpp index 0ffdb43d56..67d0ab7a82 100644 --- a/lib/CodeGen/CGCUDANV.cpp +++ b/lib/CodeGen/CGCUDANV.cpp @@ -74,7 +74,7 @@ public: llvm::Function *makeModuleDtorFunction() override; }; -} // namespace +} CGNVCUDARuntime::CGNVCUDARuntime(CodeGenModule &CGM) : CGCUDARuntime(CGM), Context(CGM.getLLVMContext()), diff --git a/lib/CodeGen/CGCUDARuntime.h b/lib/CodeGen/CGCUDARuntime.h index 05e36e6131..dcacf97032 100644 --- a/lib/CodeGen/CGCUDARuntime.h +++ b/lib/CodeGen/CGCUDARuntime.h @@ -59,7 +59,7 @@ public: /// Creates an instance of a CUDA runtime class. CGCUDARuntime *CreateNVCUDARuntime(CodeGenModule &CGM); -} // namespace CodeGen -} // namespace clang +} +} #endif diff --git a/lib/CodeGen/CGCXXABI.h b/lib/CodeGen/CGCXXABI.h index b8f3dee07c..b6b4ee6850 100644 --- a/lib/CodeGen/CGCXXABI.h +++ b/lib/CodeGen/CGCXXABI.h @@ -542,7 +542,7 @@ CGCXXABI *CreateItaniumCXXABI(CodeGenModule &CGM); /// Creates a Microsoft-family ABI. CGCXXABI *CreateMicrosoftCXXABI(CodeGenModule &CGM); -} // namespace CodeGen -} // namespace clang +} +} #endif diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 4fbcac1b22..58ef171df0 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -2843,7 +2843,7 @@ struct DestroyUnpassedArg : EHScopeStack::Cleanup { } }; -} // namespace +} struct DisableDebugLocationUpdates { CodeGenFunction &CGF; diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index cfba8db632..4d6a4e288d 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -384,7 +384,7 @@ namespace { // external code might potentially access the vtable. void VisitCXXThisExpr(const CXXThisExpr *E) { UsesThis = true; } }; -} // namespace +} static bool BaseInitializerUsesThis(ASTContext &C, const Expr *Init) { DynamicThisUseChecker Checker(C); @@ -860,7 +860,7 @@ namespace { CodeGenFunction &CGF; SanitizerSet OldSanOpts; }; -} // namespace +} namespace { class FieldMemcpyizer { @@ -1228,7 +1228,7 @@ namespace { } }; -} // namespace +} /// EmitCtorPrologue - This routine generates necessary code to initialize /// base classes and non-static data members belonging to this constructor. @@ -1531,7 +1531,7 @@ namespace { flags.isForNormalCleanup() && useEHCleanupForArray); } }; -} // namespace +} /// \brief Emit all code that comes at the end of class's /// destructor. This is to call destructors on members and base classes @@ -1892,7 +1892,7 @@ namespace { /*Delegating=*/true, Addr); } }; -} // namespace +} void CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor, @@ -1945,7 +1945,7 @@ namespace { /*Delegating=*/false, Addr); } }; -} // namespace +} void CodeGenFunction::PushDestructorCleanup(const CXXDestructorDecl *D, llvm::Value *Addr) { diff --git a/lib/CodeGen/CGCleanup.h b/lib/CodeGen/CGCleanup.h index 792cc07bdb..81c64123df 100644 --- a/lib/CodeGen/CGCleanup.h +++ b/lib/CodeGen/CGCleanup.h @@ -551,7 +551,7 @@ EHScopeStack::stabilize(iterator ir) const { return stable_iterator(EndOfBuffer - ir.Ptr); } -} // namespace CodeGen -} // namespace clang +} +} #endif diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 97c0f2af29..07dbce4252 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -522,7 +522,7 @@ namespace { CGF.EmitLifetimeEnd(Size, Addr); } }; -} // namespace +} /// EmitAutoVarWithLifetime - Does the setup required for an automatic /// variable with lifetime. @@ -1586,7 +1586,7 @@ namespace { ElementType, Destroyer); } }; -} // namespace +} /// pushIrregularPartialArrayCleanup - Push an EH cleanup to destroy /// already-constructed elements of the given array. The cleanup @@ -1651,7 +1651,7 @@ namespace { CGF.EmitARCRelease(Param, Precise); } }; -} // namespace +} /// Emit an alloca (or GlobalValue depending on target) /// for the specified parameter and set up LocalDeclMap. diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 935facba1e..4c8501724b 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -110,7 +110,7 @@ namespace { static const EHPersonality MSVC_C_specific_handler; static const EHPersonality MSVC_CxxFrameHandler3; }; -} // namespace +} const EHPersonality EHPersonality::GNU_C = { "__gcc_personality_v0", nullptr }; const EHPersonality @@ -361,7 +361,7 @@ namespace { CGF.EmitNounwindRuntimeCall(getFreeExceptionFn(CGF.CGM), exn); } }; -} // namespace +} // Emits an exception expression into the given location. This // differs from EmitAnyExprToMem only in that, if a final copy-ctor @@ -1081,7 +1081,7 @@ namespace { CGF.EnsureInsertPoint(); } }; -} // namespace +} /// Enters a finally block for an implementation using zero-cost /// exceptions. This is mostly general, but hard-codes some @@ -1332,7 +1332,7 @@ struct PerformSEHFinally : EHScopeStack::Cleanup { CGF.EmitCall(FnInfo, OutlinedFinally, ReturnValueSlot(), Args); } }; -} // namespace +} namespace { /// Find all local variable captures in the statement. @@ -1367,7 +1367,7 @@ struct CaptureFinder : ConstStmtVisitor<CaptureFinder> { Captures.push_back(ParentThis); } }; -} // namespace +} void CodeGenFunction::EmitCapturedLocals(CodeGenFunction &ParentCGF, const Stmt *OutlinedStmt, diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 20c3c6b15b..1a76afaf11 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2242,7 +2242,7 @@ enum class CheckRecoverableKind { /// Runtime conditionally aborts, always need to support recovery. AlwaysRecoverable }; -} // namespace +} static CheckRecoverableKind getRecoverableKind(SanitizerMask Kind) { assert(llvm::countPopulation(Kind) == 1); diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index d3a4fd29d9..f0f706d7b9 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -1213,7 +1213,7 @@ namespace { EmitNewDeleteCall(CGF, OperatorDelete, FPT, DeleteArgs); } }; -} // namespace +} /// Enter a cleanup to call 'operator delete' if the initializer in a /// new-expression throws. @@ -1437,7 +1437,7 @@ namespace { CGF.EmitDeleteCall(OperatorDelete, Ptr, ElementType); } }; -} // namespace +} void CodeGenFunction::pushCallObjectDeleteCleanup(const FunctionDecl *OperatorDelete, @@ -1564,7 +1564,7 @@ namespace { EmitNewDeleteCall(CGF, OperatorDelete, DeleteFTy, Args); } }; -} // namespace +} /// Emit the code for deleting an array of objects. static void EmitArrayDelete(CodeGenFunction &CGF, diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index e88d62425b..acfb9b6dbb 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -421,7 +421,7 @@ struct BaseInfo { bool operator<(const BaseInfo &O) const { return Offset < O.Offset; } }; -} // namespace +} void ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD, bool IsPrimaryBase, diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 09f92ad3be..9981fccb3e 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -448,7 +448,7 @@ struct FinishARCDealloc : EHScopeStack::Cleanup { method); } }; -} // namespace +} /// StartObjCMethod - Begin emission of an ObjCMethod. This generates /// the LLVM function and sets the other context used by @@ -599,7 +599,7 @@ namespace { CharUnits IvarSize; CharUnits IvarAlignment; }; -} // namespace +} /// Pick an implementation strategy for the given property synthesis. PropertyImplStrategy::PropertyImplStrategy(CodeGenModule &CGM, @@ -1296,7 +1296,7 @@ namespace { flags.isForNormalCleanup() && useEHCleanupForArray); } }; -} // namespace +} /// Like CodeGenFunction::destroyARCStrong, but do it with a call. static void destroyARCStrongWithStore(CodeGenFunction &CGF, @@ -1724,7 +1724,7 @@ namespace { CGF.EmitARCRelease(object, ARCImpreciseLifetime); } }; -} // namespace +} /// Produce the code for a CK_ARCConsumeObject. Does a primitive /// release at the end of the full-expression. @@ -2340,7 +2340,7 @@ namespace { CGF.EmitObjCMRRAutoreleasePoolPop(Token); } }; -} // namespace +} void CodeGenFunction::EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr) { if (CGM.getLangOpts().ObjCAutoRefCount) diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 95326b3987..a45446a706 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -3500,7 +3500,7 @@ namespace { void emitWriteHazard(); void emitHazardsInNewBlocks(); }; -} // namespace +} /// Create the fragile-ABI read and write hazards based on the current /// state of the function, which is presumed to be immediately prior diff --git a/lib/CodeGen/CGObjCRuntime.cpp b/lib/CodeGen/CGObjCRuntime.cpp index 009c0d916f..5290a87ceb 100644 --- a/lib/CodeGen/CGObjCRuntime.cpp +++ b/lib/CodeGen/CGObjCRuntime.cpp @@ -167,7 +167,7 @@ namespace { CGF.EmitRuntimeCallOrInvoke(Fn); } }; -} // namespace +} void CGObjCRuntime::EmitTryCatchStmt(CodeGenFunction &CGF, @@ -307,7 +307,7 @@ namespace { CGF.Builder.CreateCall(SyncExitFn, SyncArg)->setDoesNotThrow(); } }; -} // namespace +} void CGObjCRuntime::EmitAtSynchronizedStmt(CodeGenFunction &CGF, const ObjCAtSynchronizedStmt &S, diff --git a/lib/CodeGen/CGObjCRuntime.h b/lib/CodeGen/CGObjCRuntime.h index 396d8e8296..4752546498 100644 --- a/lib/CodeGen/CGObjCRuntime.h +++ b/lib/CodeGen/CGObjCRuntime.h @@ -295,6 +295,6 @@ public: //TODO: This should include some way of selecting which runtime to target. CGObjCRuntime *CreateGNUObjCRuntime(CodeGenModule &CGM); CGObjCRuntime *CreateMacObjCRuntime(CodeGenModule &CGM); -} // namespace CodeGen -} // namespace clang +} +} #endif diff --git a/lib/CodeGen/CGOpenCLRuntime.h b/lib/CodeGen/CGOpenCLRuntime.h index 54d979f649..0c50b92914 100644 --- a/lib/CodeGen/CGOpenCLRuntime.h +++ b/lib/CodeGen/CGOpenCLRuntime.h @@ -46,7 +46,7 @@ public: virtual llvm::Type *convertOpenCLSpecificType(const Type *T); }; -} // namespace CodeGen -} // namespace clang +} +} #endif diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp index b28770e256..c89d5cc389 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -212,7 +212,7 @@ private: CGRecordLowering(const CGRecordLowering &) = delete; void operator =(const CGRecordLowering &) = delete; }; -} // namespace +} // namespace { CGRecordLowering::CGRecordLowering(CodeGenTypes &Types, const RecordDecl *D, bool Packed) : Types(Types), Context(Types.getContext()), D(D), diff --git a/lib/CodeGen/CodeGenAction.cpp b/lib/CodeGen/CodeGenAction.cpp index 89d01a191b..54e6b73b30 100644 --- a/lib/CodeGen/CodeGenAction.cpp +++ b/lib/CodeGen/CodeGenAction.cpp @@ -258,7 +258,7 @@ namespace clang { }; void BackendConsumer::anchor() {} -} // namespace clang +} /// ConvertBackendLocation - Convert a location in a temporary llvm::SourceMgr /// buffer to be a valid FullSourceLoc. diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 79a1dcbb4f..2dd5414795 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1435,7 +1435,7 @@ namespace { return true; } }; -} // namespace +} // isTriviallyRecursive - Check if this function calls another // decl that, because of the asm attribute or the other decl being a builtin, diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 28582f54b4..8e671fa787 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -44,7 +44,7 @@ class DataLayout; class FunctionType; class LLVMContext; class IndexedInstrProfReader; -} // namespace llvm +} namespace clang { class TargetCodeGenInfo; diff --git a/lib/CodeGen/CodeGenPGO.cpp b/lib/CodeGen/CodeGenPGO.cpp index 51b44b794a..f182a469b3 100644 --- a/lib/CodeGen/CodeGenPGO.cpp +++ b/lib/CodeGen/CodeGenPGO.cpp @@ -605,7 +605,7 @@ struct ComputeRegionCounts : public ConstStmtVisitor<ComputeRegionCounts> { RecordNextStmtCount = true; } }; -} // namespace +} void PGOHash::combine(HashType Type) { // Check that we never combine 0 and only have six bits. diff --git a/lib/CodeGen/CoverageMappingGen.cpp b/lib/CodeGen/CoverageMappingGen.cpp index 92c206de8f..9ad5d14edf 100644 --- a/lib/CodeGen/CoverageMappingGen.cpp +++ b/lib/CodeGen/CoverageMappingGen.cpp @@ -884,7 +884,7 @@ struct CounterCoverageMappingBuilder // propagate counts into them. } }; -} // namespace +} static bool isMachO(const CodeGenModule &CGM) { return CGM.getTarget().getTriple().isOSBinFormatMachO(); diff --git a/lib/CodeGen/ItaniumCXXABI.cpp b/lib/CodeGen/ItaniumCXXABI.cpp index a6de477399..3f5ad5db01 100644 --- a/lib/CodeGen/ItaniumCXXABI.cpp +++ b/lib/CodeGen/ItaniumCXXABI.cpp @@ -336,7 +336,7 @@ public: // ARM64 libraries are prepared for non-unique RTTI. bool shouldRTTIBeUnique() const override { return false; } }; -} // namespace +} CodeGen::CGCXXABI *CodeGen::CreateItaniumCXXABI(CodeGenModule &CGM) { switch (CGM.getTarget().getCXXABI().getKind()) { @@ -1743,7 +1743,7 @@ namespace { Guard); } }; -} // namespace +} /// The ARM code here follows the Itanium code closely enough that we /// just special-case it at particular places. @@ -2250,7 +2250,7 @@ public: /// \param Force - true to force the creation of this RTTI value llvm::Constant *BuildTypeInfo(QualType Ty, bool Force = false); }; -} // namespace +} llvm::GlobalVariable *ItaniumRTTIBuilder::GetAddrOfTypeName( QualType Ty, llvm::GlobalVariable::LinkageTypes Linkage) { @@ -3347,7 +3347,7 @@ namespace { CGF.EmitRuntimeCallOrInvoke(getEndCatchFn(CGF.CGM)); } }; -} // namespace +} /// Emits a call to __cxa_begin_catch and enters a cleanup to call /// __cxa_end_catch. diff --git a/lib/CodeGen/MicrosoftCXXABI.cpp b/lib/CodeGen/MicrosoftCXXABI.cpp index f085a90838..679516bfa8 100644 --- a/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/lib/CodeGen/MicrosoftCXXABI.cpp @@ -707,7 +707,7 @@ private: llvm::StructType *CatchHandlerTypeType; }; -} // namespace +} CGCXXABI::RecordArgABI MicrosoftCXXABI::getRecordArgABI(const CXXRecordDecl *RD) const { @@ -2195,7 +2195,7 @@ struct CallInitThreadAbort : EHScopeStack::Cleanup { CGF.EmitNounwindRuntimeCall(getInitThreadAbortFn(CGF.CGM), Guard); } }; -} // namespace +} void MicrosoftCXXABI::EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D, llvm::GlobalVariable *GV, diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp index 158ee906d0..25e57401fd 100644 --- a/lib/CodeGen/ModuleBuilder.cpp +++ b/lib/CodeGen/ModuleBuilder.cpp @@ -232,7 +232,7 @@ namespace { Builder->AddDependentLib(Lib); } }; -} // namespace +} void CodeGenerator::anchor() { } diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index d4d0e78709..00fe2bf022 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -685,7 +685,7 @@ public: } }; -} // namespace +} /// Rewrite input constraint references after adding some output constraints. /// In the case where there is one output and one input and we add one output, @@ -1768,7 +1768,7 @@ void WinX86_64TargetCodeGenInfo::setTargetAttributes(const Decl *D, addStackProbeSizeTargetAttribute(D, GV, CGM); } -} // namespace +} void X86_64ABIInfo::postMerge(unsigned AggregateSize, Class &Lo, Class &Hi) const { @@ -3173,7 +3173,7 @@ public: } }; -} // namespace +} llvm::Value *PPC32_SVR4_ABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, @@ -3453,7 +3453,7 @@ public: } }; -} // namespace +} // Return true if the ABI requires Ty to be passed sign- or zero- // extended to 64 bits. @@ -3999,7 +3999,7 @@ public: bool doesReturnSlotInterfereWithArgs() const override { return false; } }; -} // namespace +} ABIArgInfo AArch64ABIInfo::classifyArgumentType(QualType Ty) const { Ty = useFirstFieldIfTransparentUnion(Ty); @@ -4627,7 +4627,7 @@ void WindowsARMTargetCodeGenInfo::setTargetAttributes( ARMTargetCodeGenInfo::setTargetAttributes(D, GV, CGM); addStackProbeSizeTargetAttribute(D, GV, CGM); } -} // namespace +} void ARMABIInfo::computeInfo(CGFunctionInfo &FI) const { if (!getCXXABI().classifyReturnType(FI)) @@ -5201,7 +5201,7 @@ void NVPTXTargetCodeGenInfo::addNVVMMetadata(llvm::Function *F, StringRef Name, // Append metadata to nvvm.annotations MD->addOperand(llvm::MDNode::get(Ctx, MDVals)); } -} // namespace +} //===----------------------------------------------------------------------===// // SystemZ ABI Implementation @@ -5242,7 +5242,7 @@ public: : TargetCodeGenInfo(new SystemZABIInfo(CGT, HasVector)) {} }; -} // namespace +} bool SystemZABIInfo::isPromotableIntegerType(QualType Ty) const { // Treat an enum type as its underlying type. @@ -5552,7 +5552,7 @@ public: CodeGen::CodeGenModule &M) const override; }; -} // namespace +} void MSP430TargetCodeGenInfo::setTargetAttributes(const Decl *D, llvm::GlobalValue *GV, @@ -5634,7 +5634,7 @@ public: return SizeOfUnwindException; } }; -} // namespace +} void MipsABIInfo::CoerceToIntArgs( uint64_t TySize, SmallVectorImpl<llvm::Type *> &ArgList) const { @@ -6001,7 +6001,7 @@ void TCETargetCodeGenInfo::setTargetAttributes( } } -} // namespace +} //===----------------------------------------------------------------------===// // Hexagon ABI Implementation @@ -6036,7 +6036,7 @@ public: } }; -} // namespace +} void HexagonABIInfo::computeInfo(CGFunctionInfo &FI) const { if (!getCXXABI().classifyReturnType(FI)) @@ -6150,7 +6150,7 @@ public: CodeGen::CodeGenModule &M) const override; }; -} // namespace +} void AMDGPUTargetCodeGenInfo::setTargetAttributes( const Decl *D, diff --git a/lib/CodeGen/TargetInfo.h b/lib/CodeGen/TargetInfo.h index 97ac04229e..bf63265f02 100644 --- a/lib/CodeGen/TargetInfo.h +++ b/lib/CodeGen/TargetInfo.h @@ -226,6 +226,6 @@ public: return 0; } }; -} // namespace clang +} #endif diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2ba969d667..2367914cc0 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2322,7 +2322,7 @@ enum OpenMPRuntimeKind { /// on this runtime library name. OMPRT_IOMP5 }; -} // namespace +} /// Compute the desired OpenMP runtime from the flag provided. static OpenMPRuntimeKind getOpenMPRuntime(const ToolChain &TC, diff --git a/lib/Driver/Tools.h b/lib/Driver/Tools.h index 58ee29bfb9..753f542622 100644 --- a/lib/Driver/Tools.h +++ b/lib/Driver/Tools.h @@ -234,7 +234,7 @@ namespace arm { const char* getLLVMArchSuffixForARM(StringRef CPU, StringRef Arch); void appendEBLinkFlags(const llvm::opt::ArgList &Args, ArgStringList &CmdArgs, const llvm::Triple &Triple); -} // namespace arm +} namespace mips { typedef enum { @@ -252,7 +252,7 @@ namespace mips { StringRef ABIName, StringRef FloatABI); bool shouldUseFPXX(const llvm::opt::ArgList &Args, const llvm::Triple &Triple, StringRef CPUName, StringRef ABIName, StringRef FloatABI); -} // namespace mips +} namespace ppc { bool hasPPCAbiArg(const llvm::opt::ArgList &Args, const char *Value); @@ -371,7 +371,7 @@ namespace darwin { const char *LinkingOutput) const override; }; -} // namespace darwin +} /// openbsd -- Directly call GNU Binutils assembler and linker namespace openbsd { @@ -516,7 +516,7 @@ namespace gnutools { const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} // namespace gnutools +} namespace nacltools { class LLVM_LIBRARY_VISIBILITY AssembleARM : public gnutools::Assemble { @@ -542,7 +542,7 @@ namespace nacltools { const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} // namespace nacltools +} /// minix -- Directly call GNU Binutils assembler and linker namespace minix { @@ -731,7 +731,7 @@ public: const llvm::opt::ArgList &TCArgs, const char *LinkingOutput) const override; }; -} // namespace CrossWindows +} /// SHAVE tools -- Directly call moviCompile and moviAsm namespace SHAVE { diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 7ad2feced2..0feeaa007f 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -293,8 +293,8 @@ template <> struct DocumentListTraits<std::vector<FormatStyle>> { return Seq[Index]; } }; -} // namespace yaml -} // namespace llvm +} +} namespace clang { namespace format { diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 28771e2bc7..52776b6a84 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -158,7 +158,7 @@ namespace { void HandleTopLevelSingleDecl(Decl *D); }; -} // namespace +} void ASTViewer::HandleTopLevelSingleDecl(Decl *D) { if (isa<FunctionDecl>(D) || isa<ObjCMethodDecl>(D)) { diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 3cf202d283..01c56bdc4d 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -96,7 +96,7 @@ namespace { /// \brief Erase temporary files and the preamble file. void Cleanup(); }; -} // namespace +} static llvm::sys::SmartMutex<false> &getOnDiskMutex() { static llvm::sys::SmartMutex<false> M(/* recursive = */ true); @@ -972,7 +972,7 @@ public: } }; -} // namespace +} std::unique_ptr<ASTConsumer> PrecompilePreambleAction::CreateASTConsumer(CompilerInstance &CI, @@ -2123,7 +2123,7 @@ namespace { return Next.getCodeCompletionTUInfo(); } }; -} // namespace +} /// \brief Helper function that computes which global names are hidden by the /// local code-completion results. diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index 1b20df64ab..be30d43a84 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -71,7 +71,7 @@ protected: void ReadMethodPool(Selector Sel) override; bool LookupUnqualified(LookupResult &R, Scope *S) override; }; -} // namespace +} static ASTReader * createASTReader(CompilerInstance &CI, StringRef pchFile, diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 514484a47f..250c992cbd 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1910,7 +1910,7 @@ namespace { llvm::APInt getAsInteger() const; }; -} // namespace +} void ModuleSignature::add(uint64_t Value, unsigned int NumBits) { CurValue |= Value << CurBit; diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index 30fdf946a6..0995ab4bf0 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -198,7 +198,7 @@ public: bool visitInputFile(StringRef Filename, bool isSystem, bool isOverridden) override; }; -} // namespace +} DependencyFileGenerator::DependencyFileGenerator(void *Impl) : Impl(Impl) { } diff --git a/lib/Frontend/DependencyGraph.cpp b/lib/Frontend/DependencyGraph.cpp index f384f490e6..67a977e38b 100644 --- a/lib/Frontend/DependencyGraph.cpp +++ b/lib/Frontend/DependencyGraph.cpp @@ -57,7 +57,7 @@ public: } }; -} // namespace +} void clang::AttachDependencyGraphGen(Preprocessor &PP, StringRef OutputFile, StringRef SysRoot) { diff --git a/lib/Frontend/DiagnosticRenderer.cpp b/lib/Frontend/DiagnosticRenderer.cpp index 52908371d3..c63e98dbe4 100644 --- a/lib/Frontend/DiagnosticRenderer.cpp +++ b/lib/Frontend/DiagnosticRenderer.cpp @@ -87,7 +87,7 @@ public: } }; -} // namespace +} static void mergeFixits(ArrayRef<FixItHint> FixItHints, const SourceManager &SM, const LangOptions &LangOpts, diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp index bcfd77e3a8..6f202a1548 100644 --- a/lib/Frontend/FrontendActions.cpp +++ b/lib/Frontend/FrontendActions.cpp @@ -554,7 +554,7 @@ namespace { } #undef DUMP_BOOLEAN }; -} // namespace +} void DumpModuleInfoAction::ExecuteAction() { // Set up the output file. diff --git a/lib/Frontend/HeaderIncludeGen.cpp b/lib/Frontend/HeaderIncludeGen.cpp index f0a2cc6300..5732e5b3fb 100644 --- a/lib/Frontend/HeaderIncludeGen.cpp +++ b/lib/Frontend/HeaderIncludeGen.cpp @@ -44,7 +44,7 @@ public: SrcMgr::CharacteristicKind FileType, FileID PrevFID) override; }; -} // namespace +} void clang::AttachHeaderIncludeGen(Preprocessor &PP, bool ShowAllHeaders, StringRef OutputPath, bool ShowDepth, diff --git a/lib/Frontend/ModuleDependencyCollector.cpp b/lib/Frontend/ModuleDependencyCollector.cpp index 539f9b008f..67852dc020 100644 --- a/lib/Frontend/ModuleDependencyCollector.cpp +++ b/lib/Frontend/ModuleDependencyCollector.cpp @@ -35,7 +35,7 @@ public: bool visitInputFile(StringRef Filename, bool IsSystem, bool IsOverridden) override; }; -} // namespace +} void ModuleDependencyCollector::attachToASTReader(ASTReader &R) { R.addListener(llvm::make_unique<ModuleDependencyListener>(*this)); diff --git a/lib/Frontend/Rewrite/FixItRewriter.cpp b/lib/Frontend/Rewrite/FixItRewriter.cpp index 3b8a2077c6..dc787ac955 100644 --- a/lib/Frontend/Rewrite/FixItRewriter.cpp +++ b/lib/Frontend/Rewrite/FixItRewriter.cpp @@ -69,7 +69,7 @@ public: } }; -} // namespace +} bool FixItRewriter::WriteFixedFiles( std::vector<std::pair<std::string, std::string> > *RewrittenFiles) { diff --git a/lib/Frontend/Rewrite/HTMLPrint.cpp b/lib/Frontend/Rewrite/HTMLPrint.cpp index b2706110d9..22ccfe6936 100644 --- a/lib/Frontend/Rewrite/HTMLPrint.cpp +++ b/lib/Frontend/Rewrite/HTMLPrint.cpp @@ -45,7 +45,7 @@ namespace { void Initialize(ASTContext &context) override; void HandleTranslationUnit(ASTContext &Ctx) override; }; -} // namespace +} std::unique_ptr<ASTConsumer> clang::CreateHTMLPrinter(raw_ostream *OS, Preprocessor &PP, diff --git a/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/lib/Frontend/Rewrite/RewriteModernObjC.cpp index cfd790c53f..e13cdb3a3e 100644 --- a/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -609,7 +609,7 @@ namespace { } }; -} // namespace +} void RewriteModernObjC::RewriteBlocksInFunctionProtoType(QualType funcType, NamedDecl *D) { diff --git a/lib/Frontend/Rewrite/RewriteObjC.cpp b/lib/Frontend/Rewrite/RewriteObjC.cpp index 56f0606196..b2a45b407b 100644 --- a/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteObjC.cpp @@ -540,7 +540,7 @@ namespace { std::string &Result) override; Stmt *RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) override; }; -} // namespace +} void RewriteObjC::RewriteBlocksInFunctionProtoType(QualType funcType, NamedDecl *D) { diff --git a/lib/Frontend/SerializedDiagnosticReader.cpp b/lib/Frontend/SerializedDiagnosticReader.cpp index 75fce89a2a..0ebbd22af2 100644 --- a/lib/Frontend/SerializedDiagnosticReader.cpp +++ b/lib/Frontend/SerializedDiagnosticReader.cpp @@ -287,7 +287,7 @@ class SDErrorCategoryType final : public std::error_category { llvm_unreachable("Unknown error type!"); } }; -} // namespace +} static llvm::ManagedStatic<SDErrorCategoryType> ErrorCategory; const std::error_category &clang::serialized_diags::SDErrorCategory() { diff --git a/lib/Frontend/VerifyDiagnosticConsumer.cpp b/lib/Frontend/VerifyDiagnosticConsumer.cpp index b673efcbab..55df9361b5 100644 --- a/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -301,7 +301,7 @@ private: const char *PEnd; // previous next/search subject end (1-past) }; -} // namespace +} // namespace anonymous /// ParseDirective - Go through the comment and see if it indicates expected /// diagnostics. If so, then put them in the appropriate directive list. diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index 4ef0674f8d..306401c5e6 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/lib/Lex/ModuleMap.cpp @@ -1069,7 +1069,7 @@ namespace clang { bool parseModuleMapFile(); }; -} // namespace clang +} SourceLocation ModuleMapParser::consumeToken() { retry: @@ -1263,7 +1263,7 @@ namespace { /// \brief The 'exhaustive' attribute. AT_exhaustive }; -} // namespace +} /// \brief Parse a module declaration. /// diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index df7eec248d..4451302339 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -52,7 +52,7 @@ public: void setEnd(SourceLocation L) { Range.setEnd(L); } }; -} // namespace +} static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec, Token &PeekTok, bool ValueLive, diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index c2750f6a80..5f63d35c5b 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -721,7 +721,7 @@ public: return CacheExists; } }; -} // namespace clang +} std::unique_ptr<FileSystemStatCache> PTHManager::createStatCache() { return llvm::make_unique<PTHStatCache>(*FileLookup); diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 9e3d7b0bbe..5eb665549e 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -157,7 +157,7 @@ public: Failed = true; } }; -} // namespace +} /// Handle_Pragma - Read a _Pragma directive, slice it up, process it, then /// return the first token after the directive. The _Pragma token has just diff --git a/lib/Lex/PreprocessingRecord.cpp b/lib/Lex/PreprocessingRecord.cpp index 824546a2c8..a423041a2d 100644 --- a/lib/Lex/PreprocessingRecord.cpp +++ b/lib/Lex/PreprocessingRecord.cpp @@ -195,7 +195,7 @@ struct PPEntityComp { } }; -} // namespace +} unsigned PreprocessingRecord::findBeginLocalPreprocessedEntity( SourceLocation Loc) const { diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp index 6ccd7a9dad..da759c7652 100644 --- a/lib/Parse/ParseExpr.cpp +++ b/lib/Parse/ParseExpr.cpp @@ -485,7 +485,7 @@ class CastExpressionIdValidator : public CorrectionCandidateCallback { Token NextToken; bool AllowNonTypes; }; -} // namespace +} /// \brief Parse a cast-expression, or, if \pisUnaryExpression is true, parse /// a unary-expression. diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index d35d658171..b658cef234 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -142,7 +142,7 @@ public: private: Token NextToken; }; -} // namespace +} StmtResult Parser::ParseStatementOrDeclarationAfterAttributes(StmtVector &Stmts, diff --git a/lib/Parse/ParseStmtAsm.cpp b/lib/Parse/ParseStmtAsm.cpp index b89e446486..8cdae6a74b 100644 --- a/lib/Parse/ParseStmtAsm.cpp +++ b/lib/Parse/ParseStmtAsm.cpp @@ -174,7 +174,7 @@ private: TheParser.Diag(Loc, diag::err_inline_ms_asm_parsing) << D.getMessage(); } }; -} // namespace +} /// Parse an identifier in an MS-style inline assembly block. /// diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp index 76afcda96a..d63cf24bcd 100644 --- a/lib/Parse/ParseTentative.cpp +++ b/lib/Parse/ParseTentative.cpp @@ -1023,7 +1023,7 @@ public: return CorrectionCandidateCallback::ValidateCandidate(Candidate); } }; -} // namespace +} /// isCXXDeclarationSpecifier - Returns TPResult::True if it is a declaration /// specifier, TPResult::False if it is not, TPResult::Ambiguous if it could /// be either a decl-specifier or a function-style cast, and TPResult::Error diff --git a/lib/Rewrite/DeltaTree.cpp b/lib/Rewrite/DeltaTree.cpp index 4ff3d7d8bf..352fab077a 100644 --- a/lib/Rewrite/DeltaTree.cpp +++ b/lib/Rewrite/DeltaTree.cpp @@ -149,7 +149,7 @@ namespace { static inline bool classof(const DeltaTreeNode *N) { return !N->isLeaf(); } }; -} // namespace +} /// Destroy - A 'virtual' destructor. diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp index 8c5589b43a..36030b99a3 100644 --- a/lib/Sema/AnalysisBasedWarnings.cpp +++ b/lib/Sema/AnalysisBasedWarnings.cpp @@ -99,7 +99,7 @@ namespace { } } }; -} // namespace +} /// CheckUnreachable - Check for unreachable code. static void CheckUnreachable(Sema &S, AnalysisDeclContext &AC) { @@ -493,7 +493,7 @@ struct CheckFallThroughDiagnostics { } }; -} // namespace +} /// CheckFallThroughForFunctionDef - Check that we don't fall off the end of a /// function that should return a value. Check that we don't fall off the end @@ -601,7 +601,7 @@ public: bool doesContainReference() const { return FoundReference; } }; -} // namespace +} static bool SuggestInitializationFixit(Sema &S, const VarDecl *VD) { QualType VariableTy = VD->getType().getCanonicalType(); @@ -1059,7 +1059,7 @@ namespace { Sema &S; llvm::SmallPtrSet<const CFGBlock *, 16> ReachableBlocks; }; -} // namespace +} static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC, bool PerFunction) { @@ -1414,7 +1414,7 @@ private: }); } }; -} // namespace +} namespace clang { namespace { @@ -1432,8 +1432,7 @@ struct SortDiagBySourceLocation { return SM.isBeforeInTranslationUnit(left.first.first, right.first.first); } }; -} // namespace -} // namespace clang +}} //===----------------------------------------------------------------------===// // -Wthread-safety @@ -1794,9 +1793,7 @@ public: Warnings.emplace_back(std::move(Warning), OptionalNotes()); } }; -} // namespace -} // namespace consumed -} // namespace clang +}}} //===----------------------------------------------------------------------===// // AnalysisBasedWarnings - Worker object used by Sema to execute analysis-based diff --git a/lib/Sema/SemaAccess.cpp b/lib/Sema/SemaAccess.cpp index 1d7d27c0f0..0e973cc5eb 100644 --- a/lib/Sema/SemaAccess.cpp +++ b/lib/Sema/SemaAccess.cpp @@ -248,7 +248,7 @@ private: const CXXRecordDecl *DeclaringClass; }; -} // namespace +} /// Checks whether one class might instantiate to the other. static bool MightInstantiateTo(const CXXRecordDecl *From, @@ -679,7 +679,7 @@ struct ProtectedFriendContext { return findFriendship(Cur, 0); } }; -} // namespace +} /// Search for a class P that EC is a friend of, under the constraint /// InstanceContext <= P diff --git a/lib/Sema/SemaCXXScopeSpec.cpp b/lib/Sema/SemaCXXScopeSpec.cpp index aeea26b4e3..9e146ed3a6 100644 --- a/lib/Sema/SemaCXXScopeSpec.cpp +++ b/lib/Sema/SemaCXXScopeSpec.cpp @@ -419,7 +419,7 @@ class NestedNameSpecifierValidatorCCC : public CorrectionCandidateCallback { Sema &SRef; }; -} // namespace +} /// \brief Build a new nested-name-specifier for "identifier::", as described /// by ActOnCXXNestedNameSpecifier. diff --git a/lib/Sema/SemaCast.cpp b/lib/Sema/SemaCast.cpp index db3f19607f..d9dc4df9f2 100644 --- a/lib/Sema/SemaCast.cpp +++ b/lib/Sema/SemaCast.cpp @@ -140,7 +140,7 @@ namespace { PlaceholderKind = (BuiltinType::Kind) 0; } }; -} // namespace +} // The Try functions attempt a specific way of casting. If they succeed, they // return TC_Success. If their way of casting is not appropriate for the given diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index af49994b26..f76727cad8 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -3198,7 +3198,7 @@ protected: bool IsStringLocation, Range StringRange, ArrayRef<FixItHint> Fixit = None); }; -} // namespace +} SourceRange CheckFormatHandler::getFormatStringRange() { return OrigFormatExpr->getSourceRange(); @@ -3552,7 +3552,7 @@ public: const Expr *E); }; -} // namespace +} bool CheckPrintfHandler::HandleInvalidPrintfConversionSpecifier( const analyze_printf::PrintfSpecifier &FS, @@ -4275,7 +4275,7 @@ public: void HandleIncompleteScanList(const char *start, const char *end) override; }; -} // namespace +} void CheckScanfHandler::HandleIncompleteScanList(const char *start, const char *end) { @@ -7944,7 +7944,7 @@ public: Tree.merge(Elts[I]); } }; -} // namespace +} void Sema::CheckUnsequencedOperations(Expr *E) { SmallVector<Expr *, 8> WorkList; @@ -8338,7 +8338,7 @@ namespace { Range = e->getSourceRange(); } }; -} // namespace +} /// Consider whether capturing the given variable can possibly lead to /// a retain cycle. @@ -8484,7 +8484,7 @@ namespace { } } }; -} // namespace +} /// Check whether the given argument is a block which captures a /// variable. @@ -9322,7 +9322,7 @@ bool isLayoutCompatible(ASTContext &C, QualType T1, QualType T2) { return false; } -} // namespace +} //===--- CHECK: pointer_with_type_tag attribute: datatypes should match ----// diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 284f7cf8d5..ebb6bbcd34 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -342,7 +342,7 @@ namespace { bool IsImpossibleToSatisfy(const NamedDecl *ND) const; //@} }; -} // namespace +} class ResultBuilder::ShadowMapEntry::iterator { llvm::PointerUnion<const NamedDecl *, const DeclIndexPair *> DeclOrIterator; @@ -1264,7 +1264,7 @@ namespace { Results.AddResult(Result, CurContext, Hiding, InBaseClass); } }; -} // namespace +} /// \brief Add type specifiers for the current language as keyword results. static void AddTypeSpecifierResults(const LangOptions &LangOpts, diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ee03994058..ce89d993f3 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -89,7 +89,7 @@ class TypeNameValidatorCCC : public CorrectionCandidateCallback { bool AllowClassTemplates; }; -} // namespace +} /// \brief Determine whether the token kind starts a simple-type-specifier. bool Sema::isSimpleTypeSpecifier(tok::TokenKind Kind) const { @@ -2501,7 +2501,7 @@ struct GNUCompatibleParamWarning { QualType PromotedType; }; -} // namespace +} /// getSpecialMember - get the special member enum for a method. Sema::CXXSpecialMember Sema::getSpecialMember(const CXXMethodDecl *MD) { @@ -6607,7 +6607,7 @@ class DifferentNameValidatorCCC : public CorrectionCandidateCallback { CXXRecordDecl *ExpectedParent; }; -} // namespace +} /// \brief Generate diagnostics for an invalid function redeclaration. /// @@ -8759,7 +8759,7 @@ namespace { SelfReferenceChecker(S, OrigDecl).CheckExpr(E); } -} // namespace +} /// AddInitializerToDecl - Adds the initializer Init to the /// declaration dcl. If DirectInit is true, this is C++ direct diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 471a03e123..7ed9bfcb97 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -145,7 +145,7 @@ namespace { return S->Diag(Lambda->getLocStart(), diag::err_lambda_capture_default_arg); } -} // namespace +} void Sema::ImplicitExceptionSpecification::CalledDecl(SourceLocation CallLoc, @@ -2834,7 +2834,7 @@ private: CXXRecordDecl *ClassDecl; }; -} // namespace +} /// \brief Handle a C++ member initializer. MemInitResult @@ -3756,7 +3756,7 @@ struct BaseAndFieldInfo { return false; } }; -} // namespace +} /// \brief Determine whether the given type is an incomplete or zero-lenfgth /// array type. @@ -4215,7 +4215,7 @@ bool CheckRedundantUnionInit(Sema &S, return false; } -} // namespace +} /// ActOnMemInitializers - Handle the member initializers for a constructor. void Sema::ActOnMemInitializers(Decl *ConstructorDecl, @@ -4637,7 +4637,7 @@ void AbstractUsageInfo::CheckType(const NamedDecl *D, TypeLoc TL, CheckAbstractUsage(*this, D).Visit(TL, Sel); } -} // namespace +} /// Check for invalid uses of an abstract type in a method declaration. static void CheckAbstractClassUsage(AbstractUsageInfo &Info, @@ -5508,7 +5508,7 @@ struct SpecialMemberDeletionInfo { bool isAccessible(Subobject Subobj, CXXMethodDecl *D); }; -} // namespace +} /// Is the given special member inaccessible when used on the given /// sub-object. @@ -7517,7 +7517,7 @@ public: } }; -} // namespace +} static bool TryNamespaceTypoCorrection(Sema &S, LookupResult &R, Scope *Sc, CXXScopeSpec &SS, @@ -8883,7 +8883,7 @@ struct DeclaringSpecialMember { return WasAlreadyBeingDeclared; } }; -} // namespace +} CXXConstructorDecl *Sema::DeclareImplicitDefaultConstructor( CXXRecordDecl *ClassDecl) { @@ -9267,7 +9267,7 @@ private: typedef llvm::DenseMap<const Type *, InheritingConstructorsForType> MapType; MapType Map; }; -} // namespace +} void Sema::DeclareInheritingConstructors(CXXRecordDecl *ClassDecl) { // Defer declaring the inheriting constructors until the class is @@ -13484,7 +13484,7 @@ namespace { return false; } }; -} // namespace +} bool Sema::checkThisInStaticMemberFunctionType(CXXMethodDecl *Method) { TypeSourceInfo *TSInfo = Method->getTypeSourceInfo(); diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 6ca4734dfe..543566fdb7 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -446,7 +446,7 @@ class ObjCInterfaceValidatorCCC : public CorrectionCandidateCallback { ObjCInterfaceDecl *CurrentIDecl; }; -} // namespace +} static void diagnoseUseOfProtocols(Sema &TheSema, ObjCContainerDecl *CD, @@ -3059,7 +3059,7 @@ private: searchFromContainer(container); } }; -} // namespace +} void Sema::CheckObjCMethodOverrides(ObjCMethodDecl *ObjCMethod, ObjCInterfaceDecl *CurrentClass, @@ -3717,7 +3717,7 @@ namespace { return true; } }; -} // namespace +} void Sema::DiagnoseUnusedBackingIvarInAccessor(Scope *S, const ObjCImplementationDecl *ImplD) { diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f26b5368a3..ffa47eeb58 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1138,7 +1138,7 @@ ExprResult doComplexIntegralCast(Sema &S, Expr *op, QualType toType) { return S.ImpCastExprToType(op, S.Context.getComplexType(toType), CK_IntegralComplexCast); } -} // namespace +} /// \brief Handle integer arithmetic conversions. Helper function of /// UsualArithmeticConversions() @@ -4257,7 +4257,7 @@ public: private: const IdentifierInfo *const FunctionName; }; -} // namespace +} static TypoCorrection TryTypoCorrectionForCall(Sema &S, Expr *Fn, FunctionDecl *FDecl, @@ -11974,7 +11974,7 @@ namespace { return E; } }; -} // namespace +} ExprResult Sema::TransformToPotentiallyEvaluated(Expr *E) { assert(isUnevaluatedContext() && @@ -13310,7 +13310,7 @@ namespace { bool TraverseTemplateArgument(const TemplateArgument &Arg); bool TraverseRecordType(RecordType *T); }; -} // namespace +} bool MarkReferencedDecls::TraverseTemplateArgument( const TemplateArgument &Arg) { @@ -13409,7 +13409,7 @@ namespace { S.UpdateMarkingForLValueToRValue(E->getSubExpr()); } }; -} // namespace +} /// \brief Mark any declarations that appear within this expression or any /// potentially-evaluated subexpressions as "referenced". @@ -13705,7 +13705,7 @@ namespace { return resolveDecl(E, E->getDecl()); } }; -} // namespace +} /// Given a function expression of unknown-any type, try to rebuild it /// to have a function type. @@ -13796,7 +13796,7 @@ namespace { return resolveDecl(E, E->getDecl()); } }; -} // namespace +} /// Rebuilds a call expression which yielded __unknown_anytype. ExprResult RebuildUnknownAnyExpr::VisitCallExpr(CallExpr *E) { diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 43c097e39e..6c839f356f 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -2424,7 +2424,7 @@ private: /// in-class initializer. MismatchResult analyzeInClassInitializer(); }; -} // namespace +} MismatchingNewDeleteDetector::MismatchResult MismatchingNewDeleteDetector::analyzeDeleteExpr(const CXXDeleteExpr *DE) { @@ -6571,7 +6571,7 @@ public: return CacheEntry = ExprError(); } }; -} // namespace +} ExprResult Sema::CorrectDelayedTyposInExpr(Expr *E, VarDecl *InitDecl, diff --git a/lib/Sema/SemaExprMember.cpp b/lib/Sema/SemaExprMember.cpp index d01640a369..e421349338 100644 --- a/lib/Sema/SemaExprMember.cpp +++ b/lib/Sema/SemaExprMember.cpp @@ -579,7 +579,7 @@ private: const RecordDecl *const Record; }; -} // namespace +} static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R, Expr *BaseExpr, diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index f6a5a067dd..9947fad70d 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1895,7 +1895,7 @@ class ObjCInterfaceOrSuperCCC : public CorrectionCandidateCallback { } }; -} // namespace +} Sema::ObjCMessageKind Sema::getObjCMessageKind(Scope *S, IdentifierInfo *Name, @@ -3184,7 +3184,7 @@ namespace { } } }; -} // namespace +} bool Sema::isKnownName(StringRef name) { if (name.empty()) diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 5c149e116a..821d7f64b2 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1915,7 +1915,7 @@ class FieldInitializerValidatorCCC : public CorrectionCandidateCallback { RecordDecl *Record; }; -} // namespace +} /// @brief Check the well-formedness of a C99 designated initializer. /// diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index b13b99237d..3fd1f21ba3 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -204,7 +204,7 @@ namespace { UnqualUsingEntry::Comparator())); } }; -} // namespace +} // Retrieve the set of identifier namespaces that correspond to a // specific kind of name lookup. @@ -875,7 +875,7 @@ struct FindLocalExternScope { LookupResult &R; bool OldFindLocalExtern; }; -} // namespace +} bool Sema::CppLookupName(LookupResult &R, Scope *S) { assert(getLangOpts().CPlusPlus && "Can perform only C++ lookup"); @@ -2121,7 +2121,7 @@ namespace { Sema::AssociatedClassSet &Classes; SourceLocation InstantiationLoc; }; -} // namespace +} static void addAssociatedClassesAndNamespaces(AssociatedLookup &Result, QualType T); diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index b6559b2e21..e609fcf1d9 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -4924,7 +4924,7 @@ public: Diags.popMappings(SavedLoc); } }; -} // namespace +} OMPClause *Sema::ActOnOpenMPFirstprivateClause(ArrayRef<Expr *> VarList, SourceLocation StartLoc, diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 072dc55c0a..a0fdcd78e5 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -536,7 +536,7 @@ namespace { struct DFIParamWithArguments : DFIArguments { TemplateParameter Param; }; -} // namespace +} /// \brief Convert from Sema's representation of template deduction information /// to the form used in overload-candidate information. @@ -794,7 +794,7 @@ namespace { *i->Addr = i->Saved; } }; -} // namespace +} /// checkPlaceholderForOverload - Do any interesting placeholder-like /// preprocessing on the given expression. @@ -9555,7 +9555,7 @@ struct CompareOverloadCandidatesForDisplay { return S.SourceMgr.isBeforeInTranslationUnit(LLoc, RLoc); } }; -} // namespace +} /// CompleteNonViableCandidate - Normally, overload resolution only /// computes up to the first. Produces the FixIt set if possible. @@ -9747,7 +9747,7 @@ struct CompareTemplateSpecCandidatesForDisplay { return S.SourceMgr.isBeforeInTranslationUnit(LLoc, RLoc); } }; -} // namespace +} /// Diagnose a template argument deduction failure. /// We are treating these failures as overload failures due to bad @@ -10165,7 +10165,7 @@ public: return &Matches[0].first; } }; -} // namespace +} /// ResolveAddressOfOverloadedFunction - Try to resolve the address of /// an overloaded function (C++ [over.over]), where @p From is an @@ -10632,7 +10632,7 @@ public: } }; -} // namespace +} static std::unique_ptr<CorrectionCandidateCallback> MakeValidator(Sema &SemaRef, MemberExpr *ME, size_t NumArgs, diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index a3899883d1..3e465af963 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -338,7 +338,7 @@ namespace { ExprResult buildGet() override; ExprResult buildSet(Expr *op, SourceLocation, bool) override; }; -} // namespace +} /// Capture the given expression in an OpaqueValueExpr. OpaqueValueExpr *PseudoOpBuilder::capture(Expr *e) { diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index a7e56e7d06..50e4345216 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -530,7 +530,7 @@ namespace { return LHS < RHS.first; } }; -} // namespace +} /// CmpCaseVals - Comparison predicate for sorting case values. /// @@ -1904,7 +1904,7 @@ VarDecl *BuildForRangeVarDecl(Sema &SemaRef, SourceLocation Loc, return Decl; } -} // namespace +} static bool ObjCEnumerationCollection(Expr *Collection) { return !Collection->isTypeDependent() @@ -2116,7 +2116,7 @@ struct InvalidateOnErrorScope { Decl *D; bool Enabled; }; -} // namespace +} /// BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement. StmtResult @@ -2952,7 +2952,7 @@ bool LocalTypedefNameReferencer::VisitRecordType(const RecordType *RT) { S.MarkAnyDeclReferenced(T->getLocation(), T, /*OdrUse=*/false); return true; } -} // namespace +} TypeLoc Sema::getReturnTypeLoc(FunctionDecl *FD) const { TypeLoc TL = FD->getTypeSourceInfo()->getTypeLoc().IgnoreParens(); @@ -3489,7 +3489,7 @@ template <> struct DenseMapInfo<CatchHandlerType> { template <> struct isPodLike<CatchHandlerType> { static const bool value = true; }; -} // namespace llvm +} namespace { class CatchTypePublicBases { @@ -3526,7 +3526,7 @@ public: return false; } }; -} // namespace +} /// ActOnCXXTryBlock - Takes a try compound-statement and a number of /// handlers and creates a try statement from them. diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 5c3a015889..f4740a5cd8 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -1549,7 +1549,7 @@ struct DependencyChecker : RecursiveASTVisitor<DependencyChecker> { return TraverseType(T->getInjectedSpecializationType()); } }; -} // namespace +} /// Determines whether a given type depends on the given parameter /// list. @@ -3953,7 +3953,7 @@ namespace { bool VisitTagDecl(const TagDecl *Tag); bool VisitNestedNameSpecifier(NestedNameSpecifier *NNS); }; -} // namespace +} bool UnnamedLocalNoLinkageFinder::VisitBuiltinType(const BuiltinType*) { return false; @@ -8220,7 +8220,7 @@ namespace { return E; } }; -} // namespace +} /// \brief Rebuilds a type within the context of the current instantiation. /// diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp index c5b73f53c5..6f676ad7c5 100644 --- a/lib/Sema/SemaTemplateDeduction.cpp +++ b/lib/Sema/SemaTemplateDeduction.cpp @@ -58,7 +58,7 @@ namespace clang { /// terms of noreturn and default calling convention adjustments. TDF_InOverloadResolution = 0x20 }; -} // namespace clang +} using namespace clang; @@ -3913,7 +3913,7 @@ namespace { return TransformType(TLB, TL); } }; -} // namespace +} Sema::DeduceAutoResult Sema::DeduceAutoType(TypeSourceInfo *Type, Expr *&Init, QualType &Result) { diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index b9890d0fd3..82ff7c0ca4 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -844,7 +844,7 @@ namespace { SourceLocation loc, TemplateArgument arg); }; -} // namespace +} bool TemplateInstantiator::AlreadyTransformed(QualType T) { if (T.isNull()) diff --git a/lib/Sema/SemaTemplateVariadic.cpp b/lib/Sema/SemaTemplateVariadic.cpp index 6a31125c1f..fd3ba3549b 100644 --- a/lib/Sema/SemaTemplateVariadic.cpp +++ b/lib/Sema/SemaTemplateVariadic.cpp @@ -195,7 +195,7 @@ namespace { return true; } }; -} // namespace +} /// \brief Determine whether it's possible for an unexpanded parameter pack to /// be valid in this location. This only happens when we're in a declaration @@ -806,7 +806,7 @@ class ParameterPackValidatorCCC : public CorrectionCandidateCallback { } }; -} // namespace +} /// \brief Called when an expression computing the size of a parameter pack /// is parsed. diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index aac0862c09..03cbdfdbf1 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -242,7 +242,7 @@ namespace { savedAttrs.back()->setNext(nullptr); } }; -} // namespace +} static void spliceAttrIntoList(AttributeList &attr, AttributeList *&head) { attr.setNext(head); @@ -1409,7 +1409,7 @@ namespace { /// /// The values of this enum are used in diagnostics. enum QualifiedFunctionKind { QFK_BlockPointer, QFK_Pointer, QFK_Reference }; -} // namespace +} /// Check whether the type T is a qualified function type, and if it is, /// diagnose that it cannot be contained within the given kind of declarator. @@ -4399,7 +4399,7 @@ namespace { llvm_unreachable("unsupported TypeLoc kind in declarator!"); } }; -} // namespace +} static void fillAtomicQualLoc(AtomicTypeLoc ATL, const DeclaratorChunk &Chunk) { SourceLocation Loc; @@ -4990,7 +4990,7 @@ namespace { llvm_unreachable("unknown wrapping kind"); } }; -} // namespace +} static bool handleMSPointerTypeQualifierAttr(TypeProcessingState &State, AttributeList &Attr, @@ -5904,7 +5904,7 @@ namespace { S.Diag(Loc, DiagID) << T; } }; -} // namespace +} bool Sema::RequireCompleteExprType(Expr *E, unsigned DiagID) { TypeDiagnoserDiag Diagnoser(DiagID); diff --git a/lib/Sema/TypeLocBuilder.h b/lib/Sema/TypeLocBuilder.h index ed948676b6..82844b3914 100644 --- a/lib/Sema/TypeLocBuilder.h +++ b/lib/Sema/TypeLocBuilder.h @@ -146,6 +146,6 @@ private: } }; -} // namespace clang +} #endif diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 5ecedc7df0..7242793be2 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -1686,7 +1686,7 @@ namespace { // files. IdentifierInfo *getIdentifierInfo() const { return Found; } }; -} // namespace +} void ASTReader::updateOutOfDateIdentifier(IdentifierInfo &II) { // Note that we are loading an identifier. @@ -3954,7 +3954,7 @@ namespace { SuggestedPredefines, ExistingLangOpts); } }; -} // namespace +} bool ASTReader::readASTFileControlBlock( StringRef Filename, FileManager &FileMgr, @@ -4739,7 +4739,7 @@ struct PPEntityComp { } }; -} // namespace +} PreprocessedEntityID ASTReader::findPreprocessedEntity(SourceLocation Loc, bool EndsAfter) const { @@ -4859,7 +4859,7 @@ namespace { Optional<HeaderFileInfo> getHeaderFileInfo() const { return HFI; } }; -} // namespace +} HeaderFileInfo ASTReader::GetHeaderFileInfo(const FileEntry *FE) { HeaderFileInfoVisitor Visitor(FE); @@ -6192,7 +6192,7 @@ namespace { return false; } }; -} // namespace +} ExternalLoadResult ASTReader::FindExternalLexicalDecls(const DeclContext *DC, bool (*isKindWeWant)(Decl::Kind), @@ -6237,7 +6237,7 @@ public: } }; -} // namespace +} void ASTReader::FindFileRegionDecls(FileID File, unsigned Offset, unsigned Length, @@ -6355,7 +6355,7 @@ namespace { return FoundAnything; } }; -} // namespace +} /// \brief Retrieve the "definitive" module file for the definition of the /// given declaration context, if there is one. @@ -6504,7 +6504,7 @@ namespace { return FoundAnything && !This->VisitAll; } }; -} // namespace +} void ASTReader::completeVisibleDeclsMap(const DeclContext *DC) { if (!DC->hasExternalVisibleStorage()) @@ -6848,7 +6848,7 @@ namespace clang { StringRef Next() override; }; -} // namespace clang +} ASTIdentifierIterator::ASTIdentifierIterator(const ASTReader &Reader) : Reader(Reader), Index(Reader.ModuleMgr.size() - 1) { @@ -6960,8 +6960,7 @@ namespace clang { namespace serialization { } bool factoryHasMoreThanOneDecl() const { return FactoryHasMoreThanOneDecl; } }; -} // namespace serialization - } // namespace clang +} } // end namespace clang::serialization /// \brief Add the given set of methods to the method list. static void addMethodsToPool(Sema &S, ArrayRef<ObjCMethodDecl *> Methods, diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 136ef1a425..00ebd3ebe8 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -387,7 +387,7 @@ namespace clang { } } }; -} // namespace clang +} namespace { /// Iterator over the redeclarations of a declaration that have already @@ -423,7 +423,7 @@ public: return A.Current != B.Current; } }; -} // namespace +} template<typename DeclT> llvm::iterator_range<MergedRedeclIterator<DeclT>> merged_redecls(DeclT *D) { return llvm::iterator_range<MergedRedeclIterator<DeclT>>( @@ -2934,7 +2934,7 @@ void ASTDeclReader::attachPreviousDeclImpl(ASTReader &Reader, std::make_pair(Canon, IsUnresolved ? PrevFD : FD)); } } -} // namespace clang +} void ASTDeclReader::attachPreviousDeclImpl(ASTReader &Reader, ...) { llvm_unreachable("attachPreviousDecl on non-redeclarable declaration"); } @@ -3490,7 +3490,7 @@ namespace { return Chain; } }; -} // namespace +} void ASTReader::loadPendingDeclChain(Decl *CanonDecl) { // The decl might have been merged into something else after being added to @@ -3647,7 +3647,7 @@ namespace { return true; } }; -} // namespace +} void ASTReader::loadObjCCategories(serialization::GlobalDeclID ID, ObjCInterfaceDecl *D, diff --git a/lib/Serialization/ASTReaderInternals.h b/lib/Serialization/ASTReaderInternals.h index 9a1532780a..d1b032b27a 100644 --- a/lib/Serialization/ASTReaderInternals.h +++ b/lib/Serialization/ASTReaderInternals.h @@ -241,8 +241,8 @@ public: typedef llvm::OnDiskChainedHashTable<HeaderFileInfoTrait> HeaderFileInfoLookupTable; -} // namespace reader -} // namespace serialization +} // end namespace clang::serialization::reader +} // end namespace clang::serialization } // end namespace clang diff --git a/lib/Serialization/ASTReaderStmt.cpp b/lib/Serialization/ASTReaderStmt.cpp index ae22101b99..c15f6b0b55 100644 --- a/lib/Serialization/ASTReaderStmt.cpp +++ b/lib/Serialization/ASTReaderStmt.cpp @@ -103,7 +103,7 @@ namespace clang { void Visit##Type(Type *); #include "clang/AST/StmtNodes.inc" }; -} // namespace clang +} void ASTStmtReader:: ReadTemplateKWAndArgsInfo(ASTTemplateKWAndArgsInfo &Args, @@ -1699,7 +1699,7 @@ public: #include "clang/Basic/OpenMPKinds.def" OMPClause *readClause(); }; -} // namespace clang +} OMPClause *OMPClauseReader::readClause() { OMPClause *C; diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 45ab99cc11..5bb0bec4f5 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -98,7 +98,7 @@ namespace { #define ABSTRACT_TYPE(Class, Base) #include "clang/AST/TypeNodes.def" }; -} // namespace +} void ASTTypeWriter::VisitBuiltinType(const BuiltinType *T) { llvm_unreachable("Built-in types are never serialized"); @@ -458,7 +458,7 @@ public: void VisitFunctionTypeLoc(FunctionTypeLoc TyLoc); }; -} // namespace +} void TypeLocWriter::VisitQualifiedTypeLoc(QualifiedTypeLoc TL) { // nothing to do diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 0f813302f8..6c5bc5bbd4 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -193,7 +193,7 @@ namespace clang { Record.append(LazySpecializations.begin(), LazySpecializations.end()); } }; -} // namespace clang +} void ASTDeclWriter::Visit(Decl *D) { DeclVisitor<ASTDeclWriter>::Visit(D); diff --git a/lib/Serialization/ASTWriterStmt.cpp b/lib/Serialization/ASTWriterStmt.cpp index f58ce5fae4..a461d3f663 100644 --- a/lib/Serialization/ASTWriterStmt.cpp +++ b/lib/Serialization/ASTWriterStmt.cpp @@ -47,7 +47,7 @@ namespace clang { void Visit##Type(Type *); #include "clang/AST/StmtNodes.inc" }; -} // namespace clang +} void ASTStmtWriter:: AddTemplateKWAndArgsInfo(const ASTTemplateKWAndArgsInfo &Args) { @@ -1708,7 +1708,7 @@ public: #include "clang/Basic/OpenMPKinds.def" void writeClause(OMPClause *C); }; -} // namespace clang +} void OMPClauseWriter::writeClause(OMPClause *C) { Record.push_back(C->getClauseKind()); diff --git a/lib/Serialization/GlobalModuleIndex.cpp b/lib/Serialization/GlobalModuleIndex.cpp index 1a6fc78c5b..2c7da3e82a 100644 --- a/lib/Serialization/GlobalModuleIndex.cpp +++ b/lib/Serialization/GlobalModuleIndex.cpp @@ -52,7 +52,7 @@ namespace { /// \brief The index for identifiers. IDENTIFIER_INDEX }; -} // namespace +} /// \brief The name of the global index file. static const char * const IndexFileName = "modules.idx"; @@ -121,7 +121,7 @@ public: typedef llvm::OnDiskIterableChainedHashTable<IdentifierIndexReaderTrait> IdentifierIndexTable; -} // namespace +} GlobalModuleIndex::GlobalModuleIndex(std::unique_ptr<llvm::MemoryBuffer> Buffer, llvm::BitstreamCursor Cursor) @@ -430,7 +430,7 @@ namespace { /// \brief Write the index to the given bitstream. void writeIndex(llvm::BitstreamWriter &Stream); }; -} // namespace +} static void emitBlockID(unsigned ID, const char *Name, llvm::BitstreamWriter &Stream, @@ -493,7 +493,7 @@ namespace { return std::make_pair(k, IsInteresting); } }; -} // namespace +} bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) { // Open the module file. @@ -684,7 +684,7 @@ public: } }; -} // namespace +} void GlobalModuleIndexBuilder::writeIndex(llvm::BitstreamWriter &Stream) { using namespace llvm; @@ -882,7 +882,7 @@ namespace { return Result; } }; -} // namespace +} IdentifierIterator *GlobalModuleIndex::createIdentifierIterator() const { IdentifierIndexTable &Table = diff --git a/lib/Serialization/ModuleManager.cpp b/lib/Serialization/ModuleManager.cpp index f5dff2c165..03d8ed0e24 100644 --- a/lib/Serialization/ModuleManager.cpp +++ b/lib/Serialization/ModuleManager.cpp @@ -534,7 +534,7 @@ namespace llvm { return M->ModuleName; } }; -} // namespace llvm +} void ModuleManager::viewGraph() { llvm::ViewGraph(*this, "Modules"); diff --git a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp index 6c83bdbf24..e462e2b2f1 100644 --- a/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp +++ b/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp @@ -63,7 +63,7 @@ public: void dump() const; void dumpToStream(raw_ostream &os) const; }; -} // namespace +} static SVal computeExtentBegin(SValBuilder &svalBuilder, const MemRegion *region) { diff --git a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp index 780d80a4b7..3fd55760bc 100644 --- a/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp +++ b/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp @@ -132,7 +132,7 @@ namespace { void checkPostStmt(const ObjCArrayLiteral *AL, CheckerContext &C) const; }; -} // namespace +} void NilArgChecker::warnIfNilExpr(const Expr *E, const char *Msg, @@ -631,7 +631,7 @@ class ClassReleaseChecker : public Checker<check::PreObjCMessage> { public: void checkPreObjCMessage(const ObjCMethodCall &msg, CheckerContext &C) const; }; -} // namespace +} void ClassReleaseChecker::checkPreObjCMessage(const ObjCMethodCall &msg, CheckerContext &C) const { @@ -692,7 +692,7 @@ class VariadicMethodTypeChecker : public Checker<check::PreObjCMessage> { public: void checkPreObjCMessage(const ObjCMethodCall &msg, CheckerContext &C) const; }; -} // namespace +} /// isVariadicMessage - Returns whether the given message is a variadic message, /// where all arguments must be Objective-C types. @@ -855,7 +855,7 @@ public: const CallEvent *Call, PointerEscapeKind Kind) const; }; -} // namespace +} static bool isKnownNonNilCollectionType(QualType T) { const ObjCObjectPointerType *PT = T->getAs<ObjCObjectPointerType>(); @@ -1208,7 +1208,7 @@ public: void checkPostObjCMessage(const ObjCMethodCall &M, CheckerContext &C) const; }; -} // namespace +} ProgramStateRef ObjCNonNilReturnValueChecker::assumeExprIsNonNull(const Expr *NonNullExpr, diff --git a/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp index f698d1beb4..abfb971d4c 100644 --- a/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp @@ -184,7 +184,7 @@ public: walker.Visit(D->getBody()); } }; -} // namespace +} void ento::registerCStringSyntaxChecker(CheckerManager &mgr) { mgr.registerChecker<CStringSyntaxChecker>(); diff --git a/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp b/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp index 5b5fe1ca05..339af8f033 100644 --- a/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp @@ -241,7 +241,7 @@ public: BR); } }; -} // namespace +} void ento::registerObjCDeallocChecker(CheckerManager &mgr) { mgr.registerChecker<ObjCDeallocChecker>(); diff --git a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp index 81cd028668..0beb917833 100644 --- a/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp @@ -756,7 +756,7 @@ public: walker.Visit(D->getBody()); } }; -} // namespace +} #define REGISTER_CHECKER(name) \ void ento::register##name(CheckerManager &mgr) { \ diff --git a/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp b/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp index 6082664239..a61e658f69 100644 --- a/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp @@ -34,7 +34,7 @@ public: void VisitStmt(Stmt *S) { VisitChildren(S); } void VisitChildren(Stmt *S); }; -} // namespace +} void WalkAST::VisitChildren(Stmt *S) { for (Stmt::child_iterator I = S->child_begin(), E = S->child_end(); I!=E; ++I) diff --git a/lib/StaticAnalyzer/Checkers/ClangSACheckers.h b/lib/StaticAnalyzer/Checkers/ClangSACheckers.h index 81cb6a6032..05b4a61c5a 100644 --- a/lib/StaticAnalyzer/Checkers/ClangSACheckers.h +++ b/lib/StaticAnalyzer/Checkers/ClangSACheckers.h @@ -30,8 +30,8 @@ class CheckerRegistry; #undef CHECKER #undef GET_CHECKERS -} // namespace ento +} // end ento namespace -} // namespace clang +} // end clang namespace #endif diff --git a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp index 1494dccaa0..f4be5b3e82 100644 --- a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -77,7 +77,7 @@ public: return reachable[block->getBlockID()]; } }; -} // namespace +} void ReachableCode::computeReachableBlocks() { if (!cfg.getNumBlockIDs()) @@ -445,7 +445,7 @@ public: } } }; -} // namespace +} void ento::registerDeadStoresChecker(CheckerManager &mgr) { mgr.registerChecker<DeadStoresChecker>(); diff --git a/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp b/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp index ee486b246e..51e7a3d3ce 100644 --- a/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp +++ b/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp @@ -40,7 +40,7 @@ public: } } }; -} // namespace +} void ento::registerDominatorsTreeDumper(CheckerManager &mgr) { mgr.registerChecker<DominatorsTreeDumper>(); @@ -60,7 +60,7 @@ public: } } }; -} // namespace +} void ento::registerLiveVariablesDumper(CheckerManager &mgr) { mgr.registerChecker<LiveVariablesDumper>(); @@ -80,7 +80,7 @@ public: } } }; -} // namespace +} void ento::registerCFGViewer(CheckerManager &mgr) { mgr.registerChecker<CFGViewer>(); @@ -106,7 +106,7 @@ public: } } }; -} // namespace +} void ento::registerCFGDumper(CheckerManager &mgr) { mgr.registerChecker<CFGDumper>(); @@ -126,7 +126,7 @@ public: CG.viewGraph(); } }; -} // namespace +} void ento::registerCallGraphViewer(CheckerManager &mgr) { mgr.registerChecker<CallGraphViewer>(); @@ -146,7 +146,7 @@ public: CG.dump(); } }; -} // namespace +} void ento::registerCallGraphDumper(CheckerManager &mgr) { mgr.registerChecker<CallGraphDumper>(); @@ -185,7 +185,7 @@ public: llvm::errs() << "[stats]\n" << "num-entries = " << Keys.size() << '\n'; } }; -} // namespace +} void ento::registerConfigDumper(CheckerManager &mgr) { mgr.registerChecker<ConfigDumper>(); diff --git a/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp b/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp index 7696fabe5b..0bcebf6e77 100644 --- a/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp +++ b/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp @@ -205,7 +205,7 @@ void DirectIvarAssignment::MethodCrawler::VisitBinaryOperator( } } } -} // namespace +} // Register the checker that checks for direct accesses in all functions, // except for the initialization and copy routines. diff --git a/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp b/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp index 6317e37d88..43a2812187 100644 --- a/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp +++ b/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp @@ -41,7 +41,7 @@ public: void checkPostStmt(const ImplicitCastExpr *CastE, CheckerContext &C) const; void checkPostStmt(const CXXNewExpr *NewE, CheckerContext &C) const; }; -} // namespace +} static void recordFixedType(const MemRegion *Region, const CXXMethodDecl *MD, CheckerContext &C) { diff --git a/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp b/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp index ef7ba1670c..f36ec2c687 100644 --- a/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp @@ -31,7 +31,7 @@ class ExprInspectionChecker : public Checker< eval::Call > { public: bool evalCall(const CallExpr *CE, CheckerContext &C) const; }; -} // namespace +} bool ExprInspectionChecker::evalCall(const CallExpr *CE, CheckerContext &C) const { diff --git a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp index e71fb14e8d..02c12095b5 100644 --- a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp @@ -722,7 +722,7 @@ void IvarInvalidationCheckerImpl::MethodCrawler::VisitObjCMessageExpr( VisitStmt(ME); } -} // namespace +} // Register the checkers. namespace { @@ -738,7 +738,7 @@ public: Walker.visit(D); } }; -} // namespace +} #define REGISTER_CHECKER(name) \ void ento::register##name(CheckerManager &mgr) { \ diff --git a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp index 68ffb26f06..0b7375a4b6 100644 --- a/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp @@ -312,7 +312,7 @@ public: CheckStringRefAssignedTemporary(D, BR, this); } }; -} // namespace +} void ento::registerLLVMConventionsChecker(CheckerManager &mgr) { mgr.registerChecker<LLVMConventionsChecker>(); diff --git a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp index 1ff43c5e25..52e29368ce 100644 --- a/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp @@ -151,7 +151,7 @@ private: BugReport &BR) override; }; }; -} // namespace +} /// ProgramState traits to store the currently allocated (and not yet freed) /// symbols. This is a map from the allocated content symbol to the diff --git a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp index 817122e50a..e91347999d 100644 --- a/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp @@ -187,7 +187,7 @@ private: toScanFor(v), Context(ctx) { } }; -} // namespace +} // OutputPossibleOverflows - We've found a possible overflow earlier, // now check whether Body might contain a comparison which might be diff --git a/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp index cf255772d3..296aec6680 100644 --- a/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp @@ -246,7 +246,7 @@ public: } }; -} // namespace +} void ento::registerMallocSizeofChecker(CheckerManager &mgr) { mgr.registerChecker<MallocSizeofChecker>(); diff --git a/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp b/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp index 9d0638dee5..2be7f1d4ab 100644 --- a/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp @@ -47,7 +47,7 @@ public: void checkASTDecl(const ObjCMethodDecl *D, AnalysisManager &mgr, BugReporter &BR) const; }; -} // namespace +} void NSErrorMethodChecker::checkASTDecl(const ObjCMethodDecl *D, AnalysisManager &mgr, @@ -94,7 +94,7 @@ public: void checkASTDecl(const FunctionDecl *D, AnalysisManager &mgr, BugReporter &BR) const; }; -} // namespace +} void CFErrorFunctionChecker::checkASTDecl(const FunctionDecl *D, AnalysisManager &mgr, @@ -146,7 +146,7 @@ public: "Coding conventions (Apple)") {} }; -} // namespace +} namespace { class NSOrCFErrorDerefChecker @@ -164,7 +164,7 @@ public: CheckerContext &C) const; void checkEvent(ImplicitNullDerefEvent event) const; }; -} // namespace +} typedef llvm::ImmutableMap<SymbolRef, unsigned> ErrorOutFlag; REGISTER_TRAIT_WITH_PROGRAMSTATE(NSErrorOut, ErrorOutFlag) diff --git a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp index 6773b58161..ba82d1d1d4 100644 --- a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp @@ -36,7 +36,7 @@ public: void checkPostObjCMessage(const ObjCMethodCall &msg, CheckerContext &C) const; }; -} // namespace +} void NoReturnFunctionChecker::checkPostCall(const CallEvent &CE, CheckerContext &C) const { diff --git a/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp index 159fb8f7b9..e3fc611a7e 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp @@ -168,7 +168,7 @@ public: walker.Visit(D->getBody()); } }; -} // namespace +} void ento::registerObjCContainersASTChecker(CheckerManager &mgr) { mgr.registerChecker<ObjCContainersASTChecker>(); diff --git a/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp index a398832e7f..a2cf8e10d0 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp @@ -81,7 +81,7 @@ private: mutable bool IsInitialized; }; -} // namespace +} /// \brief Determine whether the given class has a superclass that we want /// to check. The name of the found superclass is stored in SuperclassName. diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 4b6c330ae8..71ae09c035 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -61,7 +61,7 @@ template <> struct FoldingSetTrait<RetEffect> { ID.AddInteger((unsigned) X.getObjKind()); } }; -} // namespace llvm +} // end llvm namespace //===----------------------------------------------------------------------===// // Reference-counting logic (typestate + counts). @@ -484,7 +484,7 @@ public: IdentifierInfo *getIdentifier() const { return II; } Selector getSelector() const { return S; } }; -} // namespace +} namespace llvm { template <> struct DenseMapInfo<ObjCSummaryKey> { @@ -510,7 +510,7 @@ template <> struct DenseMapInfo<ObjCSummaryKey> { } }; -} // namespace llvm +} // end llvm namespace namespace { class ObjCSummaryCache { @@ -4032,6 +4032,4 @@ CallEffects CallEffects::getEffect(const FunctionDecl *FD) { #undef createCallEffect -} // namespace objc_retain -} // namespace ento -} // namespace clang +}}} diff --git a/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp b/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp index fb135bd800..6622313c99 100644 --- a/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp @@ -34,7 +34,7 @@ class ReturnUndefChecker : public Checker< check::PreStmt<ReturnStmt> > { public: void checkPreStmt(const ReturnStmt *RS, CheckerContext &C) const; }; -} // namespace +} void ReturnUndefChecker::checkPreStmt(const ReturnStmt *RS, CheckerContext &C) const { diff --git a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp index c21f71e654..327a9e0ac4 100644 --- a/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp @@ -40,7 +40,7 @@ private: static SourceRange genName(raw_ostream &os, const MemRegion *R, ASTContext &Ctx); }; -} // namespace +} SourceRange StackAddrEscapeChecker::genName(raw_ostream &os, const MemRegion *R, ASTContext &Ctx) { diff --git a/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp b/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp index 22f4304b05..d33c977826 100644 --- a/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp @@ -34,7 +34,7 @@ class TaintTesterChecker : public Checker< check::PostStmt<Expr> > { public: void checkPostStmt(const Expr *E, CheckerContext &C) const; }; -} // namespace +} inline void TaintTesterChecker::initBugType() const { if (!BT) diff --git a/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp index 9be10ba863..fc49a46eae 100644 --- a/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp @@ -56,7 +56,7 @@ public: void checkBranchCondition(const Stmt *Condition, CheckerContext &Ctx) const; }; -} // namespace +} void UndefBranchChecker::checkBranchCondition(const Stmt *Condition, CheckerContext &Ctx) const { diff --git a/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp b/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp index 5f7f9ed020..d78de3c6f3 100644 --- a/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp @@ -48,7 +48,7 @@ private: static bool isInvalidPath(const CFGBlock *CB, const ParentMap &PM); static inline bool isEmptyCFGBlock(const CFGBlock *CB); }; -} // namespace +} void UnreachableCodeChecker::checkEndAnalysis(ExplodedGraph &G, BugReporter &B, diff --git a/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp b/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp index 5bffc41174..7e1fc1eb54 100644 --- a/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp @@ -239,7 +239,7 @@ public: } } }; -} // namespace +} void ento::registerVirtualCallChecker(CheckerManager &mgr) { mgr.registerChecker<VirtualCallChecker>(); diff --git a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp index 7e3c090953..0e90566839 100644 --- a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp +++ b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp @@ -50,7 +50,7 @@ template<> struct FoldingSetTrait<SValPair> { X.second.Profile(ID); } }; -} // namespace llvm +} typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<SValData> > PersistentSValsTy; diff --git a/lib/StaticAnalyzer/Core/BlockCounter.cpp b/lib/StaticAnalyzer/Core/BlockCounter.cpp index 6447887560..c1ac03d5ab 100644 --- a/lib/StaticAnalyzer/Core/BlockCounter.cpp +++ b/lib/StaticAnalyzer/Core/BlockCounter.cpp @@ -43,7 +43,7 @@ public: } }; -} // namespace +} typedef llvm::ImmutableMap<CountKey, unsigned> CountMap; diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index fce72dd9e9..97e97ef8c4 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -2847,7 +2847,7 @@ public: bool popNextReportGraph(ReportGraph &GraphWrapper); }; -} // namespace +} TrimmedGraph::TrimmedGraph(const ExplodedGraph *OriginalGraph, ArrayRef<const ExplodedNode *> Nodes) { diff --git a/lib/StaticAnalyzer/Core/CheckerManager.cpp b/lib/StaticAnalyzer/Core/CheckerManager.cpp index 7a4d24608c..2684cc78be 100644 --- a/lib/StaticAnalyzer/Core/CheckerManager.cpp +++ b/lib/StaticAnalyzer/Core/CheckerManager.cpp @@ -160,7 +160,7 @@ namespace { checkFn(S, C); } }; -} // namespace +} /// \brief Run checkers for visiting Stmts. void CheckerManager::runCheckersForStmt(bool isPreVisit, @@ -199,7 +199,7 @@ namespace { checkFn(*Msg.cloneWithState<ObjCMethodCall>(Pred->getState()), C); } }; -} // namespace +} /// \brief Run checkers for visiting obj-c messages. void CheckerManager::runCheckersForObjCMessage(bool isPreVisit, @@ -242,7 +242,7 @@ namespace { checkFn(*Call.cloneWithState(Pred->getState()), C); } }; -} // namespace +} /// \brief Run checkers for visiting an abstract call event. void CheckerManager::runCheckersForCallEvent(bool isPreVisit, @@ -290,7 +290,7 @@ namespace { checkFn(Loc, IsLoad, BoundEx, C); } }; -} // namespace +} /// \brief Run checkers for load/store of a location. @@ -331,7 +331,7 @@ namespace { checkFn(Loc, Val, S, C); } }; -} // namespace +} /// \brief Run checkers for binding of a value to a location. void CheckerManager::runCheckersForBind(ExplodedNodeSet &Dst, @@ -395,7 +395,7 @@ namespace { checkFn(Condition, C); } }; -} // namespace +} /// \brief Run checkers for branch condition. void CheckerManager::runCheckersForBranchCondition(const Stmt *Condition, @@ -444,7 +444,7 @@ namespace { checkFn(SR, C); } }; -} // namespace +} /// \brief Run checkers for dead symbols. void CheckerManager::runCheckersForDeadSymbols(ExplodedNodeSet &Dst, diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp index 4c255c1e26..ef515fb593 100644 --- a/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -2648,7 +2648,7 @@ struct DOTGraphTraits<ExplodedNode*> : return Out.str(); } }; -} // namespace llvm +} // end llvm namespace #endif void ExprEngine::ViewGraph(bool trim) { diff --git a/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h b/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h index c1baddd130..e7cc23ca82 100644 --- a/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h +++ b/lib/StaticAnalyzer/Core/PrettyStackTraceLocationContext.h @@ -39,7 +39,7 @@ public: } }; -} // namespace ento -} // namespace clang +} // end ento namespace +} // end clang namespace #endif diff --git a/lib/StaticAnalyzer/Core/ProgramState.cpp b/lib/StaticAnalyzer/Core/ProgramState.cpp index 5f3e18feee..60b32c722e 100644 --- a/lib/StaticAnalyzer/Core/ProgramState.cpp +++ b/lib/StaticAnalyzer/Core/ProgramState.cpp @@ -40,8 +40,7 @@ void ProgramStateRelease(const ProgramState *state) { Mgr.freeStates.push_back(s); } } -} // namespace ento -} // namespace clang +}} ProgramState::ProgramState(ProgramStateManager *mgr, const Environment& env, StoreRef st, GenericDataMap gdm) diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index dd0f6125e5..6d41fc2146 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -131,7 +131,7 @@ namespace llvm { template <> struct isPodLike<BindingKey> { static const bool value = true; }; -} // namespace llvm +} // end llvm namespace LLVM_DUMP_METHOD void BindingKey::dump() const { llvm::errs() << *this; } @@ -309,7 +309,7 @@ public: bool supportsFields() const { return SupportsFields; } }; -} // namespace +} //===----------------------------------------------------------------------===// // Main RegionStore logic. @@ -737,7 +737,7 @@ public: static_cast<DERIVED*>(this)->VisitCluster(BaseR, C); } }; -} // namespace +} //===----------------------------------------------------------------------===// // Binding invalidation. @@ -963,7 +963,7 @@ public: void VisitCluster(const MemRegion *baseR, const ClusterBindings *C); void VisitBinding(SVal V); }; -} // namespace +} void invalidateRegionsWorker::VisitBinding(SVal V) { // A symbol? Mark it touched by the invalidation. @@ -2196,7 +2196,7 @@ public: bool UpdatePostponed(); void VisitBinding(SVal V); }; -} // namespace +} void removeDeadBindingsWorker::VisitAddedToCluster(const MemRegion *baseR, const ClusterBindings &C) { diff --git a/lib/StaticAnalyzer/Core/SimpleConstraintManager.h b/lib/StaticAnalyzer/Core/SimpleConstraintManager.h index 9911a8f2bc..135cd4ef86 100644 --- a/lib/StaticAnalyzer/Core/SimpleConstraintManager.h +++ b/lib/StaticAnalyzer/Core/SimpleConstraintManager.h @@ -93,8 +93,8 @@ protected: bool Assumption); }; -} // namespace ento +} // end GR namespace -} // namespace clang +} // end clang namespace #endif diff --git a/lib/StaticAnalyzer/Frontend/ModelInjector.h b/lib/StaticAnalyzer/Frontend/ModelInjector.h index 196925030f..e23bf8abf3 100644 --- a/lib/StaticAnalyzer/Frontend/ModelInjector.h +++ b/lib/StaticAnalyzer/Frontend/ModelInjector.h @@ -68,7 +68,7 @@ private: // BodyFarm. llvm::StringMap<Stmt *> Bodies; }; -} // namespace ento -} // namespace clang +} +} #endif diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index 5e373d664e..f9cb7c6413 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -173,7 +173,7 @@ public: FrontendAction *create() override { return Action; } }; -} // namespace +} ToolInvocation::ToolInvocation( std::vector<std::string> CommandLine, ToolAction *Action, @@ -406,7 +406,7 @@ public: } }; -} // namespace +} int ClangTool::buildASTs(std::vector<std::unique_ptr<ASTUnit>> &ASTs) { ASTBuilderAction Action(ASTs); |