[Patch] Remove AllowLookup argument to DeclContext::addDecl()

Hi,

Because DeclContext::addDecl() builds lazily lookup structure,
AllowLookup parameter works only when LookupPtr != 0.
To fix it we would have to store it somehow in DeclContext.
However, I noticed that it was no single use with other value that true.
I think, the best option is to just remove it and assume it is always true.
In case it would be some cases for it in future, we could just learn
DeclContext::buildLookup() about them. Attached patch removes this argument.
It also removes needless now ASTContext argument to DeclContext::addDecl(),
and DeclContext::insert().

Piotr

0001-Minor-DeclContext-changes.patch (19.7 KB)

Hi Piotr,

Because DeclContext::addDecl() builds lazily lookup structure,
AllowLookup parameter works only when LookupPtr != 0.
To fix it we would have to store it somehow in DeclContext.
However, I noticed that it was no single use with other value that true.
I think, the best option is to just remove it and assume it is always true.
In case it would be some cases for it in future, we could just learn
DeclContext::buildLookup() about them. Attached patch removes this argument.

Great, thanks! AllowLookup was a temporary hack that predated the lazy construction of the lookup table. Now, we don't need it.

It also removes needless now ASTContext argument to DeclContext::addDecl(),
and DeclContext::insert().

Good, good. I've committed this. Thanks!

   - Doug