[cfe-dev] Entity of static functions

Argyrios Kyrtzidis kyrtzidis at apple.com
Mon Jul 20 13:52:43 PDT 2009


On Jul 20, 2009, at 1:11 PM, Ted Kremenek wrote:

> I think Entity is meant to mainly represent concepts that cross
> translation units.  When reasoning about the specifics of a
> translation unit (including static functions) we have the ASTs.  I
> think the right solution is for CallGraph to represent functions with
> something like an llvm::PointerUnion that acts as a variant type.

Static functions were disallowed to avoid the complexity of having to  
encode "translation unit that the decl came from"
so that compare semantics for Entities are correct.

I think a better way is for Entity to be just a wrapper to a  
PointerUnion (either pointer to "not crossing" Decl or pointer to an  
internal Entity implementation).
That way comparing Entities is correct also for Decls that don't cross  
translation units.

Does it make sense ?

-Argiris

>
> On Jul 20, 2009, at 1:59 AM, Zhongxing Xu wrote:
>
>> Current EntityGetter does not create entities for static functions.
>> But CallGraph represents functions with Entities uniquely. Static
>> functions should also appear in the call graph. So could EntityGetter
>> also create entities for static functions. This should not do any  
>> harm
>> to other parts of clang.
>>
>> -Zhongxing
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list