r332400 - Move helper classes into anonymous namespaces. NFCI.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue May 15 14:26:47 PDT 2018


Author: d0k
Date: Tue May 15 14:26:47 2018
New Revision: 332400

URL: http://llvm.org/viewvc/llvm-project?rev=332400&view=rev
Log:
Move helper classes into anonymous namespaces. NFCI.

Modified:
    cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
    cfe/trunk/lib/Serialization/ASTReaderDecl.cpp

Modified: cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp?rev=332400&r1=332399&r2=332400&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGOpenMPRuntime.cpp Tue May 15 14:26:47 2018
@@ -1470,9 +1470,10 @@ createConstantGlobalStruct(CodeGenModule
 }
 
 template <typename T>
-void createConstantGlobalStructAndAddToParent(CodeGenModule &CGM, QualType Ty,
-                                              ArrayRef<llvm::Constant *> Data,
-                                              T &Parent) {
+static void
+createConstantGlobalStructAndAddToParent(CodeGenModule &CGM, QualType Ty,
+                                         ArrayRef<llvm::Constant *> Data,
+                                         T &Parent) {
   const auto *RD = cast<RecordDecl>(Ty->getAsTagDecl());
   const CGRecordLayout &RL = CGM.getTypes().getCGRecordLayout(RD);
   ConstantStructBuilder Fields = Parent.beginStruct(RL.getLLVMType());

Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=332400&r1=332399&r2=332400&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Tue May 15 14:26:47 2018
@@ -2552,11 +2552,11 @@ void ASTDeclReader::mergeRedeclarable(Re
 /// 6.1.2.6/1). Although most merging is done in Sema, we need to guarantee
 /// that some types are mergeable during deserialization, otherwise name
 /// lookup fails. This is the case for EnumConstantDecl.
-bool allowODRLikeMergeInC(NamedDecl *ND) {
+static bool allowODRLikeMergeInC(NamedDecl *ND) {
   if (!ND)
     return false;
   // TODO: implement merge for other necessary decls.
-  if (dyn_cast<EnumConstantDecl>(ND))
+  if (isa<EnumConstantDecl>(ND))
     return true;
   return false;
 }




More information about the cfe-commits mailing list