[cfe-commits] r117104 - in /cfe/trunk/lib: AST/RecordLayoutBuilder.cpp Checker/BasicObjCFoundationChecks.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Oct 22 09:33:16 PDT 2010


Author: d0k
Date: Fri Oct 22 11:33:16 2010
New Revision: 117104

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

Modified:
    cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
    cfe/trunk/lib/Checker/BasicObjCFoundationChecks.cpp

Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=117104&r1=117103&r2=117104&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original)
+++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Fri Oct 22 11:33:16 2010
@@ -1603,15 +1603,17 @@
                         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

Modified: cfe/trunk/lib/Checker/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BasicObjCFoundationChecks.cpp?rev=117104&r1=117103&r2=117104&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/Checker/BasicObjCFoundationChecks.cpp Fri Oct 22 11:33:16 2010
@@ -81,15 +81,16 @@
 // 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,





More information about the cfe-commits mailing list