diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-06 22:17:16 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-06 22:17:16 +0000 |
commit | 6d60a4ec1955d633c12eeea1422e3c505064c511 (patch) | |
tree | 49dcd9d7197970438edd3774736fccc6cfe4b985 /clang/lib/AST/DeclGroup.cpp | |
parent | 292b3842a01cb901d5adcec3e5dc9b44b00b41b7 (diff) | |
download | bcm5719-llvm-6d60a4ec1955d633c12eeea1422e3c505064c511.tar.gz bcm5719-llvm-6d60a4ec1955d633c12eeea1422e3c505064c511.zip |
Modified DeclGroupRef to always load/store the internal pointer value as Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues.
llvm-svn: 57213
Diffstat (limited to 'clang/lib/AST/DeclGroup.cpp')
-rw-r--r-- | clang/lib/AST/DeclGroup.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/AST/DeclGroup.cpp b/clang/lib/AST/DeclGroup.cpp index 6ec0e5beafa..34b37dada5c 100644 --- a/clang/lib/AST/DeclGroup.cpp +++ b/clang/lib/AST/DeclGroup.cpp @@ -43,17 +43,18 @@ void DeclGroup::Destroy(ASTContext& C) { } DeclGroupOwningRef::~DeclGroupOwningRef() { - assert (Raw == 0 && "Destroy method not called."); + assert (D == 0 && "Destroy method not called."); } void DeclGroupOwningRef::Destroy(ASTContext& C) { - if (!Raw) + if (!D) return; if (getKind() == DeclKind) - reinterpret_cast<Decl*>(Raw)->Destroy(C); - else - reinterpret_cast<DeclGroup*>(Raw & ~Mask)->Destroy(C); + D->Destroy(C); + else + reinterpret_cast<DeclGroup*>(reinterpret_cast<uintptr_t>(D) & + ~Mask)->Destroy(C); - Raw = 0; + D = 0; } |