Author: d0k Date: Wed Oct 28 08:54:16 2015 New Revision: 251514 URL: http://llvm.org/viewvc/llvm-project?rev=251514&view=rev Log: Put global classes into the appropriate namespace.
Most of the cases belong into an anonymous namespace. No functionality change intended. Modified: cfe/trunk/include/clang/Sema/CodeCompleteOptions.h cfe/trunk/lib/CodeGen/CGBuiltin.cpp cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp cfe/trunk/lib/Driver/ToolChains.cpp cfe/trunk/lib/Driver/Tools.cpp cfe/trunk/lib/Parse/ParsePragma.cpp cfe/trunk/lib/Sema/SemaDecl.cpp cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Modified: cfe/trunk/include/clang/Sema/CodeCompleteOptions.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/CodeCompleteOptions.h?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/include/clang/Sema/CodeCompleteOptions.h (original) +++ cfe/trunk/include/clang/Sema/CodeCompleteOptions.h Wed Oct 28 08:54:16 2015 @@ -10,6 +10,8 @@ #ifndef LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H #define LLVM_CLANG_SEMA_CODECOMPLETEOPTIONS_H +namespace clang { + /// Options controlling the behavior of code completion. class CodeCompleteOptions { public: @@ -33,5 +35,7 @@ public: { } }; +} // namespace clang + #endif Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original) +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Wed Oct 28 08:54:16 2015 @@ -2111,7 +2111,8 @@ enum { AddRetType | VectorizeRetType | Add1ArgType | InventFloatType }; - struct NeonIntrinsicInfo { +namespace { +struct NeonIntrinsicInfo { unsigned BuiltinID; unsigned LLVMIntrinsic; unsigned AltLLVMIntrinsic; @@ -2122,6 +2123,7 @@ enum { return BuiltinID < RHSBuiltinID; } }; +} // end anonymous namespace #define NEONMAP0(NameBase) \ { NEON::BI__builtin_neon_ ## NameBase, 0, 0, #NameBase, 0 } Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original) +++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Wed Oct 28 08:54:16 2015 @@ -2601,7 +2601,7 @@ void CGOpenMPRuntime::emitTaskCall( /// (references element of array in original variable). /// \param RedOpGen Generator of reduction operation with use of LHSVar and /// RHSVar. -void EmitOMPAggregateReduction( +static void EmitOMPAggregateReduction( CodeGenFunction &CGF, QualType Type, const VarDecl *LHSVar, const VarDecl *RHSVar, const llvm::function_ref<void(CodeGenFunction &CGF, const Expr *, Modified: cfe/trunk/lib/Driver/ToolChains.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains.cpp Wed Oct 28 08:54:16 2015 @@ -1562,6 +1562,7 @@ static bool isMicroMips(const ArgList &A return A && A->getOption().matches(options::OPT_mmicromips); } +namespace { struct DetectedMultilibs { /// The set of multilibs that the detected installation supports. MultilibSet Multilibs; @@ -1573,6 +1574,7 @@ struct DetectedMultilibs { /// targeting the non-default multilib. Otherwise, it is empty. llvm::Optional<Multilib> BiarchSibling; }; +} // end anonymous namespace static Multilib makeMultilib(StringRef commonSuffix) { return Multilib(commonSuffix, commonSuffix, commonSuffix); Modified: cfe/trunk/lib/Driver/Tools.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/Driver/Tools.cpp (original) +++ cfe/trunk/lib/Driver/Tools.cpp Wed Oct 28 08:54:16 2015 @@ -5369,12 +5369,14 @@ static bool maybeConsumeDash(const std:: return !HaveDash; } +namespace { struct EHFlags { EHFlags() : Synch(false), Asynch(false), NoExceptC(false) {} bool Synch; bool Asynch; bool NoExceptC; }; +} // end anonymous namespace /// /EH controls whether to run destructor cleanups when exceptions are /// thrown. There are three modifiers: Modified: cfe/trunk/lib/Parse/ParsePragma.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParsePragma.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/Parse/ParsePragma.cpp (original) +++ cfe/trunk/lib/Parse/ParsePragma.cpp Wed Oct 28 08:54:16 2015 @@ -334,6 +334,7 @@ void Parser::HandlePragmaVisibility() { Actions.ActOnPragmaVisibility(VisType, VisLoc); } +namespace { struct PragmaPackInfo { Sema::PragmaPackKind Kind; IdentifierInfo *Name; @@ -341,6 +342,7 @@ struct PragmaPackInfo { SourceLocation LParenLoc; SourceLocation RParenLoc; }; +} // end anonymous namespace void Parser::HandlePragmaPack() { assert(Tok.is(tok::annot_pragma_pack)); @@ -750,11 +752,13 @@ bool Parser::HandlePragmaMSInitSeg(Strin return true; } +namespace { struct PragmaLoopHintInfo { Token PragmaName; Token Option; ArrayRef<Token> Toks; }; +} // end anonymous namespace static std::string PragmaLoopHintString(Token PragmaName, Token Option) { std::string PragmaString; Modified: cfe/trunk/lib/Sema/SemaDecl.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaDecl.cpp (original) +++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Oct 28 08:54:16 2015 @@ -14011,6 +14011,7 @@ static bool ValidDuplicateEnum(EnumConst return false; } +namespace { struct DupKey { int64_t val; bool isTombstoneOrEmptyKey; @@ -14034,6 +14035,7 @@ struct DenseMapInfoDupKey { LHS.val == RHS.val; } }; +} // end anonymous namespace // Emits a warning when an element is implicitly set a value that // a previous element has already been set to. Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=251514&r1=251513&r2=251514&view=diff ============================================================================== --- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original) +++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Wed Oct 28 08:54:16 2015 @@ -2192,6 +2192,7 @@ PathDiagnosticPiece *CFRefReportVisitor: return P; } +namespace { // Find the first node in the current function context that referred to the // tracked symbol and the memory location that value was stored to. Note, the // value is only reported if the allocation occurred in the same function as @@ -2206,6 +2207,7 @@ struct AllocationInfo { const LocationContext *InInterestingMethodContext) : N(InN), R(InR), InterestingMethodContext(InInterestingMethodContext) {} }; +} // end anonymous namespace static AllocationInfo GetAllocationSite(ProgramStateManager& StateMgr, const ExplodedNode *N, _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits