[cfe-commits] r76708 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Jul 21 17:42:46 PDT 2009
Author: fjahanian
Date: Tue Jul 21 19:42:46 2009
New Revision: 76708
URL: http://llvm.org/viewvc/llvm-project?rev=76708&view=rev
Log:
Minor mod. per Doug's comment.
Modified:
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/lib/AST/DeclCXX.cpp
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=76708&r1=76707&r2=76708&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Tue Jul 21 19:42:46 2009
@@ -890,6 +890,12 @@
/// };
/// @endcode
class CXXDestructorDecl : public CXXMethodDecl {
+ enum KindOfObjectToDestroy {
+ VBASE = 0x1,
+ DRCTNONVBASE = 0x2,
+ ANYBASE = 0x3
+ };
+
/// ImplicitlyDefined - Whether this destructor was implicitly
/// defined by the compiler. When false, the destructor was defined
/// by the user. In C++03, this flag will have the same value as
@@ -900,7 +906,10 @@
/// Support for base and member destruction.
/// BaseOrMemberDestructions - The arguments used to destruct the base
- /// or member.
+ /// or member. Each uintptr_t value represents one of base classes (either
+ /// virtual or direct non-virtual base), or non-static data member
+ /// to be destroyed. The low two bits encode the kind of object
+ /// being destroyed.
uintptr_t *BaseOrMemberDestructions;
unsigned NumBaseOrMemberDestructions;
@@ -975,21 +984,21 @@
/// isVbaseToDestroy - returns true, if object is virtual base.
bool isVbaseToDestroy(uintptr_t Vbase) const {
- return (Vbase & 0x1) != 0;
+ return (Vbase & VBASE) != 0;
}
/// isDirectNonVBaseToDestroy - returns true, if object is direct non-virtual
/// base.
bool isDirectNonVBaseToDestroy(uintptr_t DrctNonVbase) const {
- return (DrctNonVbase & 0x2) != 0;
+ return (DrctNonVbase & DRCTNONVBASE) != 0;
}
/// isAnyBaseToDestroy - returns true, if object is any base (virtual or
/// direct non-virtual)
bool isAnyBaseToDestroy(uintptr_t AnyBase) const {
- return (AnyBase & 0x3) != 0;
+ return (AnyBase & ANYBASE) != 0;
}
/// isMemberToDestroy - returns true if object is a non-static data member.
bool isMemberToDestroy(uintptr_t Member) const {
- return (Member & 0x3) == 0;
+ return (Member & ANYBASE) == 0;
}
/// getAnyBaseClassToDestroy - Get the type for the given base class object.
Type *getAnyBaseClassToDestroy(uintptr_t Base) const {
Modified: cfe/trunk/lib/AST/DeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclCXX.cpp?rev=76708&r1=76707&r2=76708&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclCXX.cpp (original)
+++ cfe/trunk/lib/AST/DeclCXX.cpp Tue Jul 21 19:42:46 2009
@@ -498,7 +498,7 @@
if (BaseClassDecl->hasTrivialDestructor())
continue;
uintptr_t Member =
- reinterpret_cast<uintptr_t>(VBase->getType().getTypePtr()) | 0x1;
+ reinterpret_cast<uintptr_t>(VBase->getType().getTypePtr()) | VBASE;
AllToDestruct.push_back(Member);
}
for (CXXRecordDecl::base_class_iterator Base =
@@ -513,7 +513,7 @@
continue;
uintptr_t Member =
- reinterpret_cast<uintptr_t>(Base->getType().getTypePtr()) | 0x2;
+ reinterpret_cast<uintptr_t>(Base->getType().getTypePtr()) | DRCTNONVBASE;
AllToDestruct.push_back(Member);
}
More information about the cfe-commits
mailing list