[cfe-dev] using the compiler's method lookup from a clang plugin?

Noel Grandin via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 21 05:39:30 PST 2019


It looks like

    void Sema::LookupOverloadedOperatorName(OverloadedOperatorKind Op,
Scope *S,
                                        QualType T1, QualType T2,
                                        UnresolvedSetImpl &Functions)

is the chunk of functionality I need, but how do I call that from a
RecursiveASTVisitor plugin?

In particular, how do I get a pointer to a Scope?

Thanks, Noel Grandin


On Wed, 20 Feb 2019 at 19:51, Noel Grandin <noelgrandin at gmail.com> wrote:

> Hi
>
> I have two
>     const clang::RecordType * t1, t2
> and I want to find out if there exits an
>     operator!=
> that can be called with those two types.
>
> I've partially implemented this in my plugin, but it gets complicated
> quickly, and surely the compiler already does this?
>
> Any suggestions where to look to invoke such functionality?
>
> Thanks, Noel Grandin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190221/7ccadfb5/attachment.html>


More information about the cfe-dev mailing list