[cfe-dev] Superclass for CallExpr | CXXConstructExpr | ObjCMessageExpr

John McCall via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 3 19:44:37 PDT 2018


> On Jul 3, 2018, at 9:01 PM, Richard Smith via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> On Mon, 2 Jul 2018 at 11:09, George Karpenkov via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> Hi,
> 
> Quite a bit of code in the static analyzer is either duplicated or is using roundabout constructs
> to deal in the same way with calls of different type: CallExpr, CXXConstructExpr, ObjCMessageExpr.
> 
> What would be the objections against introducing a very simple abstract superclass for those?
> Only a few methods would be required:
> 
>  - arguments() and iterators over those
>  - return type
>  - source location
> 
> That seems reasonable to me (though as Artem points out, only arguments() seems relevant). Maybe InvokeExpr? (That matches the terminology the C++ standard uses, at least.)

I'd suggest avoiding "invoke" just because of the precedent of LLVM's call vs. invoke.  AbstractCallExpr seems reasonable to me.

John.

> 
> It'd probably be useful to have a getDirectCallee() member or similar too.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180703/63aacbf8/attachment.html>


More information about the cfe-dev mailing list