aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclGroup.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-09-26 23:19:04 +0000
committerTed Kremenek <kremenek@apple.com>2008-09-26 23:19:04 +0000
commit1377e541eacaafa3e2c4ffa86f6540e6863beadb (patch)
tree2d9068114a914f76817f96ff1fe687e642162205 /lib/AST/DeclGroup.cpp
parentd2025e26738c3017af6685e342a3a746cdf8249f (diff)
Use a union instead of a bunch of magic casts to implement a variant. This removes the type-punning errors for DeclGroup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56708 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclGroup.cpp')
-rw-r--r--lib/AST/DeclGroup.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/DeclGroup.cpp b/lib/AST/DeclGroup.cpp
index 5987d5a701..10c39283a6 100644
--- a/lib/AST/DeclGroup.cpp
+++ b/lib/AST/DeclGroup.cpp
@@ -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;
}