aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-03-27 18:46:15 +0000
committerChris Lattner <sabre@nondot.org>2009-03-27 18:46:15 +0000
commit10d8379676f32b493740a5509e2cd7f0d6433139 (patch)
tree91b936e0019ee326402c9210ef412808ca5b4bfc /lib/AST/DeclBase.cpp
parentee760330a415635369556796a97afcfd6207f4dc (diff)
change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index cb12618443..47059d952c 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -121,7 +121,8 @@ void Decl::setDeclContext(DeclContext *DC) {
if (isOutOfSemaDC())
delete getMultipleDC();
- DeclCtx = reinterpret_cast<uintptr_t>(DC);
+ DeclCtx.setPointer(DC);
+ DeclCtx.setInt(false);
}
void Decl::setLexicalDeclContext(DeclContext *DC) {
@@ -132,7 +133,8 @@ void Decl::setLexicalDeclContext(DeclContext *DC) {
MultipleDC *MDC = new MultipleDC();
MDC->SemanticDC = getDeclContext();
MDC->LexicalDC = DC;
- DeclCtx = reinterpret_cast<uintptr_t>(MDC) | 0x1;
+ DeclCtx.setPointer(MDC);
+ DeclCtx.setInt(true);
} else {
getMultipleDC()->LexicalDC = DC;
}