Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 15 11:58:51 PDT 2019
Usually the cfe-dev mailing list is better for questions like this.
The type “int” is ASTContext::IntTy. You can use QualType::withConst to add a “const” qualifier, and ASTContext::getPointerType to construct a pointer type. Putting that together, you can construct a “const int*” with something like “Context->getPointerType(Context->IntTy.withConst())”.
If you haven’t looked at the documentation yet, you might want to read https://clang.llvm.org/docs/IntroductionToTheClangAST.html and https://clang.llvm.org/docs/InternalsManual.html .
From: cfe-commits <cfe-commits-bounces at lists.llvm.org> On Behalf Of Monalisa Rout via cfe-commits
Sent: Thursday, August 15, 2019 7:03 AM
To: cfe-commits at lists.llvm.org
Subject: [EXT] QualType
I want to create QualType instances for const int, int* const, and const int* const.
How can I do that??
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits