From: Benjamin Kramer Date: Tue, 15 May 2018 21:26:47 +0000 (+0000) Subject: Move helper classes into anonymous namespaces. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=126ee5d0eecfd774597e95decef55e1532885e1f;p=clang Move helper classes into anonymous namespaces. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332400 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp index 42f1ceac67..7373331a63 100644 --- a/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/lib/CodeGen/CGOpenMPRuntime.cpp @@ -1470,9 +1470,10 @@ createConstantGlobalStruct(CodeGenModule &CGM, QualType Ty, } template -void createConstantGlobalStructAndAddToParent(CodeGenModule &CGM, QualType Ty, - ArrayRef Data, - T &Parent) { +static void +createConstantGlobalStructAndAddToParent(CodeGenModule &CGM, QualType Ty, + ArrayRef Data, + T &Parent) { const auto *RD = cast(Ty->getAsTagDecl()); const CGRecordLayout &RL = CGM.getTypes().getCGRecordLayout(RD); ConstantStructBuilder Fields = Parent.beginStruct(RL.getLLVMType()); diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 79465b5c88..a1ce26d27c 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -2552,11 +2552,11 @@ void ASTDeclReader::mergeRedeclarable(Redeclarable *DBase, T *Existing, /// 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(ND)) + if (isa(ND)) return true; return false; }