[cfe-commits] r160459 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/Calls.h lib/StaticAnalyzer/Core/Calls.cpp

Jordan Rose jordan_rose at apple.com
Thu Jul 19 17:57:34 PDT 2012


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.



More information about the cfe-commits mailing list