diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-09-26 23:19:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-09-26 23:19:04 +0000 |
commit | 6ed79f0c13217aa62f6618d2106fc185f24a4a43 (patch) | |
tree | a99c06a385154350be7a59f37f08e17e1ddf2696 | |
parent | f5e7e3ae264ed3b169d14d7f09f1360b409448f5 (diff) | |
download | bcm5719-llvm-6ed79f0c13217aa62f6618d2106fc185f24a4a43.tar.gz bcm5719-llvm-6ed79f0c13217aa62f6618d2106fc185f24a4a43.zip |
Use a union instead of a bunch of magic casts to implement a variant. This removes the type-punning errors for DeclGroup.
llvm-svn: 56708
-rw-r--r-- | clang/lib/AST/DeclGroup.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/AST/DeclGroup.cpp b/clang/lib/AST/DeclGroup.cpp index 5987d5a7012..10c39283a61 100644 --- a/clang/lib/AST/DeclGroup.cpp +++ b/clang/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; } |