aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-05-02 00:30:12 +0000
committerJohn McCall <rjmccall@apple.com>2011-05-02 00:30:12 +0000
commit7079886ab5a9df450ed773419f0ae81f8404e2aa (patch)
treeaaf9b7748fde61ea32cd3ad8a2d1742047704cd8 /lib/Serialization/ASTReaderDecl.cpp
parent3aa8140bde5b9bedf13e46ec0a668daa54814196 (diff)
Revise the representation of parameter scope data so that the
scope depth overlaps with the ObjCDeclQualifier, dropping memory usage back to previous levels. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 665516470e..3a825de6e6 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -710,9 +710,17 @@ void ASTDeclReader::VisitImplicitParamDecl(ImplicitParamDecl *PD) {
void ASTDeclReader::VisitParmVarDecl(ParmVarDecl *PD) {
VisitVarDecl(PD);
- unsigned scopeDepth = Record[Idx++], scopeIndex = Record[Idx++];
- PD->setScopeInfo(scopeDepth, scopeIndex);
- PD->ParmVarDeclBits.ObjCDeclQualifier = (Decl::ObjCDeclQualifier)Record[Idx++];
+ unsigned isObjCMethodParam = Record[Idx++];
+ unsigned scopeDepth = Record[Idx++];
+ unsigned scopeIndex = Record[Idx++];
+ unsigned declQualifier = Record[Idx++];
+ if (isObjCMethodParam) {
+ assert(scopeDepth == 0);
+ PD->setObjCMethodScopeInfo(scopeIndex);
+ PD->ParmVarDeclBits.ScopeDepthOrObjCQuals = declQualifier;
+ } else {
+ PD->setScopeInfo(scopeDepth, scopeIndex);
+ }
PD->ParmVarDeclBits.IsKNRPromoted = Record[Idx++];
PD->ParmVarDeclBits.HasInheritedDefaultArg = Record[Idx++];
if (Record[Idx++]) // hasUninstantiatedDefaultArg.