From cb9c07418b699bd2b8384d31ff4392df7d76eb7c Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 22 Oct 2010 16:33:16 +0000 Subject: [PATCH] Move classes into anonymous namespaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/RecordLayoutBuilder.cpp | 20 +++++++++++--------- lib/Checker/BasicObjCFoundationChecks.cpp | 19 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index 9444be301b..35f6d9957e 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -1603,15 +1603,17 @@ RecordLayoutBuilder::Diag(SourceLocation Loc, unsigned DiagID) { FullSourceLoc(Loc, Context.getSourceManager()), DiagID); } -// This class implements layout specific to the Microsoft ABI. -class MSRecordLayoutBuilder: public RecordLayoutBuilder { -public: - MSRecordLayoutBuilder(ASTContext& Ctx, EmptySubobjectMap *EmptySubobjects): - RecordLayoutBuilder(Ctx, EmptySubobjects) {} - - virtual bool IsNearlyEmpty(const CXXRecordDecl *RD) const; - virtual uint64_t GetVirtualPointersSize(const CXXRecordDecl *RD) const; -}; +namespace { + // This class implements layout specific to the Microsoft ABI. + class MSRecordLayoutBuilder : public RecordLayoutBuilder { + public: + MSRecordLayoutBuilder(ASTContext& Ctx, EmptySubobjectMap *EmptySubobjects) : + RecordLayoutBuilder(Ctx, EmptySubobjects) {} + + virtual bool IsNearlyEmpty(const CXXRecordDecl *RD) const; + virtual uint64_t GetVirtualPointersSize(const CXXRecordDecl *RD) const; + }; +} bool MSRecordLayoutBuilder::IsNearlyEmpty(const CXXRecordDecl *RD) const { // FIXME: Audit the corners diff --git a/lib/Checker/BasicObjCFoundationChecks.cpp b/lib/Checker/BasicObjCFoundationChecks.cpp index 6398d9415b..00b524a9be 100644 --- a/lib/Checker/BasicObjCFoundationChecks.cpp +++ b/lib/Checker/BasicObjCFoundationChecks.cpp @@ -81,15 +81,16 @@ static inline bool isNil(SVal X) { // NilArgChecker - Check for prohibited nil arguments to ObjC method calls. //===----------------------------------------------------------------------===// -class NilArgChecker : public CheckerVisitor { - APIMisuse *BT; - void AuditNSString(CheckerContext &C, const ObjCMessageExpr* ME); - void WarnNilArg(CheckerContext &C, const ObjCMessageExpr* ME, unsigned Arg); -public: - NilArgChecker() : BT(0) {} - static void *getTag() { static int x = 0; return &x; } - void PreVisitObjCMessageExpr(CheckerContext &C, const ObjCMessageExpr *ME); -}; +namespace { + class NilArgChecker : public CheckerVisitor { + APIMisuse *BT; + void WarnNilArg(CheckerContext &C, const ObjCMessageExpr* ME, unsigned Arg); + public: + NilArgChecker() : BT(0) {} + static void *getTag() { static int x = 0; return &x; } + void PreVisitObjCMessageExpr(CheckerContext &C, const ObjCMessageExpr *ME); + }; +} void NilArgChecker::WarnNilArg(CheckerContext &C, const clang::ObjCMessageExpr *ME, -- 2.40.0