]> granicus.if.org Git - clang/commitdiff
Move classes into anonymous namespaces.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 22 Oct 2010 16:33:16 +0000 (16:33 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 22 Oct 2010 16:33:16 +0000 (16:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/RecordLayoutBuilder.cpp
lib/Checker/BasicObjCFoundationChecks.cpp

index 9444be301b3d6ee4260e620c66f4a4952b5fd011..35f6d9957e9c989d70aebfa346dfbb82059eb7cf 100644 (file)
@@ -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
index 6398d9415b424ddfddd8ebc89e5909cd90e0c65d..00b524a9bee62312667dba2c154e10fa14fc05c2 100644 (file)
@@ -81,15 +81,16 @@ static inline bool isNil(SVal X) {
 // NilArgChecker - Check for prohibited nil arguments to ObjC method calls.
 //===----------------------------------------------------------------------===//
 
-class NilArgChecker : public CheckerVisitor<NilArgChecker> {
-  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<NilArgChecker> {
+    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,