aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-12 23:27:07 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-12 23:27:07 +0000
commit482b77d1cb4ca08391d1f749436f092a4cc24427 (patch)
tree5f979c605aeb3b03497b8b25074be9641b2c64ae /lib/AST/DeclBase.cpp
parent3f20a682baad7f3aa6d2b3a9a3053420e5421e32 (diff)
Cleanup DeclContext::addDecl and DeclContext::insert interface, from Piotr Rak
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62122 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index cafe5358d6..8eb52b722d 100644
--- a/lib/AST/DeclBase.cpp
+++ b/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) {