[clang] [AST] Add dump() method to TypeLoc (PR #65484)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 7 13:04:52 PDT 2023
================
@@ -96,6 +96,21 @@ void JSONNodeDumper::Visit(QualType T) {
JOS.attribute("qualifiers", T.split().Quals.getAsString());
}
+void JSONNodeDumper::Visit(TypeLoc TL) {
+ if (TL.isNull())
+ return;
+ JOS.attribute("kind",
+ (llvm::Twine(TL.getTypeLocClass() == TypeLoc::Qualified
+ ? "Qualified"
+ : TL.getTypePtr()->getTypeClassName()) +
+ "TypeLoc")
+ .str());
+ JOS.attribute("type",
+ createQualType(QualType(TL.getType()), /*Desugar*/ false));
----------------
shafik wrote:
```suggestion
createQualType(QualType(TL.getType()), /*Desugar=*/false));
```
https://github.com/llvm/llvm-project/pull/65484
More information about the cfe-commits
mailing list