diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-03-27 18:46:15 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-03-27 18:46:15 +0000 |
| commit | 586c66d5bab690c4f5f86bd7688e115cf002ab12 (patch) | |
| tree | 414baa3d7337bad32e36212ea3910f5329dba7bd /clang/lib/AST/DeclSerialization.cpp | |
| parent | a2d609e2f144e70892a04edceab28223d4bd838b (diff) | |
| download | bcm5719-llvm-586c66d5bab690c4f5f86bd7688e115cf002ab12.tar.gz bcm5719-llvm-586c66d5bab690c4f5f86bd7688e115cf002ab12.zip | |
change Decl::DeclCtx to use a PointerIntPair instead of hand bitmangling.
llvm-svn: 67858
Diffstat (limited to 'clang/lib/AST/DeclSerialization.cpp')
| -rw-r--r-- | clang/lib/AST/DeclSerialization.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/AST/DeclSerialization.cpp b/clang/lib/AST/DeclSerialization.cpp index e4534a26865..4b32d819365 100644 --- a/clang/lib/AST/DeclSerialization.cpp +++ b/clang/lib/AST/DeclSerialization.cpp @@ -125,7 +125,7 @@ Decl* Decl::Create(Deserializer& D, ASTContext& C) { Dcl->Implicit = D.ReadBool(); Dcl->Access = D.ReadInt(); - assert(Dcl->DeclCtx == 0); + assert(Dcl->DeclCtx.getOpaqueValue() == 0); const SerializedPtrID &SemaDCPtrID = D.ReadPtrID(); const SerializedPtrID &LexicalDCPtrID = D.ReadPtrID(); @@ -133,11 +133,14 @@ Decl* Decl::Create(Deserializer& D, ASTContext& C) { if (SemaDCPtrID == LexicalDCPtrID) { // Allow back-patching. Observe that we register the variable of the // *object* for back-patching. Its actual value will get filled in later. - D.ReadUIntPtr(Dcl->DeclCtx, SemaDCPtrID); + uintptr_t X; + D.ReadUIntPtr(X, SemaDCPtrID); + Dcl->DeclCtx.setFromOpaqueValue(reinterpret_cast<void*>(X)); } else { MultipleDC *MDC = new MultipleDC(); - Dcl->DeclCtx = reinterpret_cast<uintptr_t>(MDC) | 0x1; + Dcl->DeclCtx.setPointer(MDC); + Dcl->DeclCtx.setInt(true); // Allow back-patching. Observe that we register the variable of the // *object* for back-patching. Its actual value will get filled in later. D.ReadPtr(MDC->SemanticDC, SemaDCPtrID); |

