summaryrefslogtreecommitdiff
path: root/lib/AST/JSONNodeDumper.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2019-05-27 14:34:31 +0000
committerAaron Ballman <aaron@aaronballman.com>2019-05-27 14:34:31 +0000
commitdfbf171da410f5fb59a20bb37c9efd11f507b3e2 (patch)
tree4c4449fb9775715397131acbc96b63211935f8ee /lib/AST/JSONNodeDumper.cpp
parentca064d85f1099f8141fc4c85be139571ad3b1c06 (diff)
downloadclang-dfbf171da410f5fb59a20bb37c9efd11f507b3e2.tar.gz
When dumping the AST to JSON, dump the type information from a typeid expression with a type operand.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/JSONNodeDumper.cpp')
-rw-r--r--lib/AST/JSONNodeDumper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/JSONNodeDumper.cpp b/lib/AST/JSONNodeDumper.cpp
index 08f63fba98..43cad2bf26 100644
--- a/lib/AST/JSONNodeDumper.cpp
+++ b/lib/AST/JSONNodeDumper.cpp
@@ -917,6 +917,16 @@ void JSONNodeDumper::VisitAddrLabelExpr(const AddrLabelExpr *ALE) {
JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
}
+void JSONNodeDumper::VisitCXXTypeidExpr(const CXXTypeidExpr *CTE) {
+ if (CTE->isTypeOperand()) {
+ QualType Adjusted = CTE->getTypeOperand(Ctx);
+ QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
+ JOS.attribute("typeArg", createQualType(Unadjusted));
+ if (Adjusted != Unadjusted)
+ JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
+ }
+}
+
void JSONNodeDumper::VisitIntegerLiteral(const IntegerLiteral *IL) {
JOS.attribute("value",
IL->getValue().toString(