[cfe-dev] Variable declaration location

Ridwan Shariffdeen via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 25 01:20:07 PDT 2018


I didn't realize the inheritance, thanks a lot

On Wed, Jul 25, 2018 at 4:13 PM James Dennett <james.dennett at gmail.com>
wrote:

> On Wed, Jul 25, 2018 at 12:27 AM, Ridwan Shariffdeen via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>> Hi,
>>
>> I am trying to get the location of the variable declaration from
>> a DeclRefExpr.
>> Is there a way I can achieve this? There doesn't seem to be any
>> relationship with DeclRefExpr and the actual VarDecl.
>>
>
> DeclRefExpr::getDecl returns a ValueDecl*.  For a variable, that's a
> VarDecl.
>
> -- James
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180725/43d39301/attachment.html>


More information about the cfe-dev mailing list