[cfe-dev] bool type is represented as "_Bool" in the AST

Pradeep Kumar via cfe-dev cfe-dev at lists.llvm.org
Tue Jul 23 07:58:53 PDT 2019


Dear Keane,
    I am running through CUDA code. The AST nodes as far as I can see is
more like C++ like CXXRecordDecl and so on. I do pass C++ standard flag to
the tool.

Regrads,
Pradeep

On Tue, Jul 23, 2019 at 8:21 PM Keane, Erich <erich.keane at intel.com> wrote:

> Are you compiling as C, or c++?  C++ should give you “bool”, since it is
> the type, however if you’re using C, “bool” is likely typedef’ed to
> “_Bool”, so that’s the type you’re getting.
>
>
>
> *From:* cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] *On Behalf Of *Pradeep
> Kumar via cfe-dev
> *Sent:* Tuesday, July 23, 2019 7:47 AM
> *To:* cfe-dev <cfe-dev at lists.llvm.org>
> *Subject:* [cfe-dev] bool type is represented as "_Bool" in the AST
>
>
>
> Dear Clang-developer community,
>
>     I am using libTooling to query information about the source. While
> querying the string representation of the bool type, I get "_Bool" string.
> I got the string from QualType::getAsString(). Should I be using another
> function to query the actual type or is it an expected behavior?
>
>
>
>     I don't get _Bool when dumping the ast except when I dump the QualType
> Node.
>
>
>
> clang Version: 9.0
>
> LLVM Version: 9.0
>
>
>
> Regards,
>
> Pradeep
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190723/972270e3/attachment.html>


More information about the cfe-dev mailing list