[cfe-commits] r66698 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/Sema/SemaDeclCXX.cpp
Douglas Gregor
dgregor at apple.com
Wed Mar 11 13:25:10 PDT 2009
Author: dgregor
Date: Wed Mar 11 15:25:10 2009
New Revision: 66698
URL: http://llvm.org/viewvc/llvm-project?rev=66698&view=rev
Log:
Eliminate CXXClassMemberWrapper
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=66698&r1=66697&r2=66698&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Wed Mar 11 15:25:10 2009
@@ -759,36 +759,6 @@
static CXXConversionDecl* CreateImpl(llvm::Deserializer& D, ASTContext& C);
};
-/// CXXClassMemberWrapper - A wrapper class for C++ class member decls.
-/// Common functions like set/getAccess are included here to avoid bloating
-/// the interface of non-C++ specific decl classes, like NamedDecl.
-/// FIXME: Doug would like to remove this class.
-class CXXClassMemberWrapper {
- Decl *MD;
-
-public:
- CXXClassMemberWrapper(Decl *D) : MD(D) {
- assert(isMember(D) && "Not a C++ class member!");
- }
-
- AccessSpecifier getAccess() const {
- return AccessSpecifier(MD->Access);
- }
-
- void setAccess(AccessSpecifier AS) {
- assert(AS != AS_none && "Access must be specified.");
- MD->Access = AS;
- }
-
- CXXRecordDecl *getParent() const {
- return dyn_cast<CXXRecordDecl>(MD->getDeclContext());
- }
-
- static bool isMember(Decl *D) {
- return isa<CXXRecordDecl>(D->getDeclContext());
- }
-};
-
/// LinkageSpecDecl - This represents a linkage specification. For example:
/// extern "C" void foo();
///
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=66698&r1=66697&r2=66698&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Mar 11 15:25:10 2009
@@ -585,10 +585,7 @@
assert((Name || isInstField) && "No identifier for non-field ?");
- // set/getAccess is not part of Decl's interface to avoid bloating it with C++
- // specific methods. Use a wrapper class that can be used with all C++ class
- // member decls.
- CXXClassMemberWrapper(Member).setAccess(AS);
+ Member->setAccess(AS);
// C++ [dcl.init.aggr]p1:
// An aggregate is an array or a class (clause 9) with [...] no
More information about the cfe-commits
mailing list