]> granicus.if.org Git - clang/commitdiff
Put global classes into the appropriate namespace.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 28 Oct 2015 13:54:16 +0000 (13:54 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 28 Oct 2015 13:54:16 +0000 (13:54 +0000)
Most of the cases belong into an anonymous namespace. No functionality
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251514 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/CodeCompleteOptions.h
lib/CodeGen/CGBuiltin.cpp
lib/CodeGen/CGOpenMPRuntime.cpp
lib/Driver/ToolChains.cpp
lib/Driver/Tools.cpp
lib/Parse/ParsePragma.cpp
lib/Sema/SemaDecl.cpp
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp

index e43496f55bdbc5b29099c1ee56747cffba719c68..fc7713c795712bbfb6086a58193bceff77a26987 100644 (file)
@@ -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
 
index 7a3bec1bb16a3eb10bf22c2d0c4e4b1f6a9ac23f..8b8b54ddeb3f9cfb52b72c6931164bf536e1cdcc 100644 (file)
@@ -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 }
index fc3771c58fd8c639417808ee1b152792e0c218e8..30811824d538e734d3f80eb8894dfb57a02ba550 100644 (file)
@@ -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 *,
index d0f4dac3e13d425d0c0e8c0ba50b6c9302b1441d..e18656cb3df342124bdcb584569d8deaa694fbe4 100644 (file)
@@ -1562,6 +1562,7 @@ static bool isMicroMips(const ArgList &Args) {
   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);
index 1c6f86f8b5c892b291d4b607734aa00f318c8c41..e90e616bbf26408e82ffb2a0353b9002f876c62c 100644 (file)
@@ -5369,12 +5369,14 @@ static bool maybeConsumeDash(const std::string &EH, size_t &I) {
   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:
index ab2b52ec396cedcc1531867f496a92dbedeb9885..4430eb8d03da4b760b7242e5d64fc41410303550 100644 (file)
@@ -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(StringRef PragmaName,
   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;
index 43fe994784084d5aa31982cb11802f98c1cd96ec..622ff1ebbce5550346dfd49cdeddb94835aff53d 100644 (file)
@@ -14011,6 +14011,7 @@ static bool ValidDuplicateEnum(EnumConstantDecl *ECD, EnumDecl *Enum) {
   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.
index db2416c538400b2d3da1d9ac0fef75a1c1c16646..f983c3085635157b51fc87c1e9323c3f7b99829b 100644 (file)
@@ -2192,6 +2192,7 @@ PathDiagnosticPiece *CFRefReportVisitor::VisitNode(const ExplodedNode *N,
   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,