[cfe-dev] Qualifiers of a function

Nimrod Partush nimrodpar at gmail.com
Fri Nov 5 12:53:26 PDT 2010


These methods might work fine, but what i need is the location of the
qualifier. Any idea how do i translate fD->getType() to a SourceLocation?

Your help is greatly appreciated :)

On Fri, Nov 5, 2010 at 8:17 PM, Jan Bierbaum <s3306700 at inf.tu-dresden.de>wrote:

> Nimrod Partush meinte am 05.11.2010 16:19:
>
> >>> When asking for the qualifiers of:
> >>>
> >>> const int f();
> >>>
> >>> I get null. Am i doing something wrong?
> >>
> >> Well, you don't say how you do it... ;-)
> >>
> >> Probably you're making the same mistake I did some time ago. What you
> >> want is not the qualifiers of the function (it has none) but those of
> >> its return type.
> >
> > Well, i tried various ways: Getting the FuncDecl qualifiers, Getting the
> > ResultType qualifiers, Getting the TypeLoc and through that...
> >
> > Why don't you tell me how you did it? :)
>
> I'm not sure if we actually do the same thing. I need to know if the
> function returns something that is qualified and use
>
> FunctionDecl* fD;
> ...
> fD->getType().isConstQualified()
> fD->getType().isVolatileQualified()
>
> But you wrote something about getting NULL which can't happen here. That
> is why I was wondering how you try to do it. You could also have a look
> at the old thread on this list [1]. Maybe you can use some of the advice
> I got.
>
>
> [1] http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-September/010923.html
>
>
> Regards, Jan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101105/303e65fe/attachment.html>


More information about the cfe-dev mailing list