aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclGroup.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-06 22:17:16 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-06 22:17:16 +0000
commite285a9505c0be75d4b58e67aa32e82de55889235 (patch)
treee32fcbe2cafc43ad2fc1737f9e10418439f870c1 /lib/AST/DeclGroup.cpp
parent1ed8e2a39456d064a346a6a5c2f6bd53e6d57345 (diff)
Modified DeclGroupRef to always load/store the internal pointer value as Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57213 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclGroup.cpp')
-rw-r--r--lib/AST/DeclGroup.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/AST/DeclGroup.cpp b/lib/AST/DeclGroup.cpp
index 6ec0e5beaf..34b37dada5 100644
--- a/lib/AST/DeclGroup.cpp
+++ b/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;
}