]> granicus.if.org Git - clang/commitdiff
Use a union instead of a bunch of magic casts to implement a variant. This removes...
authorTed Kremenek <kremenek@apple.com>
Fri, 26 Sep 2008 23:19:04 +0000 (23:19 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 26 Sep 2008 23:19:04 +0000 (23:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56708 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclGroup.cpp

index 5987d5a7012ae473dbe28ba0f1ada149c0dce839..10c39283a61f4bd966f08f215b1955399b9fbe10 100644 (file)
@@ -43,17 +43,17 @@ void DeclGroup::Destroy(ASTContext& C) {
 }
 
 DeclGroupOwningRef::~DeclGroupOwningRef() {
-  assert (ThePtr == 0 && "Destroy method not called.");
+  assert (Raw == 0 && "Destroy method not called.");
 }
 
 void DeclGroupOwningRef::Destroy(ASTContext& C) {
-  if (!ThePtr)
+  if (!Raw)
     return;
   
   if (getKind() == DeclKind)
-    reinterpret_cast<Decl*>(ThePtr)->Destroy(C);
+    reinterpret_cast<Decl*>(Raw)->Destroy(C);
   else
-    reinterpret_cast<DeclGroup*>(ThePtr & ~Mask)->Destroy(C);
+    reinterpret_cast<DeclGroup*>(Raw & ~Mask)->Destroy(C);
   
-  ThePtr = 0;
+  Raw = 0;
 }