On Jul 19, 2012, at 5:31 PM, Anna Zaks wrote:

> There seem to be pure abstract classes in the hierarchy(please document them 
> - much harder to differentiate after this change) which you do not process in 
> the switch (probably do not have a kind for them either). It might be cleaner 
> to add them here as well. For example, getCXXThisVal() should have the 
> default implementation of returning UndefinedVal in most classes of the 
> hierarchy. Instead of duplicating the default implementation everywhere, you 
> could just add it to the top level class.

I did in fact do this in a lot of cases (see 
AnyFunctionCall::getDeclaredResultType, which is overridden by 
BlockCall::getDeclaredResultType). I'd rather not mix real code in with the 
ugly dispatchers, so having defaults in AnyFunctionCall and in ObjCMethodCall 
seems fairly good.

(Of course, if there is /no/ implementation for a type-dispatched method in the 
hierarchy, the program will go into an infinite loop. I couldn't think of a 
good way to stop this with an assert, but I guess an infinite loop isn't too 
hard to track down.)

I feel like there was a reason why getCXXThisVal() wasn't one of these default 
cases, but I'm not sure what it was. 


> Also, add a note documenting that CallEvent is a value object now.

Good idea.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to