diff options
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 6 | ||||
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 988fa1a5c3a..24172a5ddbd 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -533,7 +533,7 @@ const RecordDecl *ASTContext::addRecordToClass(const ObjCInterfaceDecl *D) RecFields[i]->getIdentifier(), RecFields[i]->getType(), RecFields[i]->getBitWidth(), false, 0); - NewRD->addDecl(*this, Field); + NewRD->addDecl(Field); } NewRD->completeDefinition(*this); RD = NewRD; @@ -1554,7 +1554,7 @@ QualType ASTContext::getCFConstantStringType() { SourceLocation(), 0, FieldTypes[i], /*BitWidth=*/0, /*Mutable=*/false, /*PrevDecl=*/0); - CFConstantStringTypeDecl->addDecl(*this, Field, true); + CFConstantStringTypeDecl->addDecl(Field); } CFConstantStringTypeDecl->completeDefinition(*this); @@ -1584,7 +1584,7 @@ QualType ASTContext::getObjCFastEnumerationStateType() SourceLocation(), 0, FieldTypes[i], /*BitWidth=*/0, /*Mutable=*/false, /*PrevDecl=*/0); - ObjCFastEnumerationStateTypeDecl->addDecl(*this, Field, true); + ObjCFastEnumerationStateTypeDecl->addDecl(Field); } ObjCFastEnumerationStateTypeDecl->completeDefinition(*this); diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index cafe5358d61..8eb52b722d4 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -514,7 +514,7 @@ DeclContext *DeclContext::getNextContext() { } } -void DeclContext::addDecl(ASTContext &Context, ScopedDecl *D, bool AllowLookup) { +void DeclContext::addDecl(ScopedDecl *D) { assert(D->getLexicalDeclContext() == this && "Decl inserted into wrong lexical context"); assert(!D->NextDeclInScope && D != LastDecl && "Decl already inserted into a DeclContext"); @@ -525,8 +525,7 @@ void DeclContext::addDecl(ASTContext &Context, ScopedDecl *D, bool AllowLookup) } else { FirstDecl = LastDecl = D; } - if (AllowLookup) - D->getDeclContext()->insert(Context, D); + D->getDeclContext()->insert(D); } /// buildLookup - Build the lookup data structure with all of the @@ -596,10 +595,10 @@ const DeclContext *DeclContext::getLookupContext() const { return Ctx; } -void DeclContext::insert(ASTContext &Context, ScopedDecl *D) { +void DeclContext::insert(ScopedDecl *D) { DeclContext *PrimaryContext = getPrimaryContext(); if (PrimaryContext != this) { - PrimaryContext->insert(Context, D); + PrimaryContext->insert(D); return; } @@ -612,7 +611,7 @@ void DeclContext::insert(ASTContext &Context, ScopedDecl *D) { // If we are a transparent context, insert into our parent context, // too. This operation is recursive. if (isTransparentContext()) - getParent()->insert(Context, D); + getParent()->insert(D); } void DeclContext::insertImpl(ScopedDecl *D) { |