[cfe-dev] Changing Scope::Entity to a DeclContext?

Douglas Gregor dgregor at apple.com
Mon Nov 8 18:45:43 PST 2010


On Nov 7, 2010, at 12:46 PM, Ryan Gerleve wrote:

> Hello!
> While working on the patch for bug 7256, I noticed that the result of
> Scope::getEntity is always used as a DeclContext*. Would it be
> reasonable to change the Entity in the Scope class to a DeclContext?

Yes! The entity is a void* for historical reasons that are long gone now [*].

> This could include:
> 
> 1. changing the type of Entity from void* to DeclContext*
> 2. renaming getEntity() to something like getDeclContext()
> 3. renaming the Entity member, perhaps to LocalDeclContext.
> 
> Many casts could be removed if this chage takes place, and it seems
> like it would make the code clearer. I'm still a clang newbie, so I may
> be missing something obvious here.


This would make a great patch.

	- Doug

[*] "Long gone", in Clang time, meaning about 2 months ago.



More information about the cfe-dev mailing list