summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/JSONNodeDumper.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/clang/lib/AST/JSONNodeDumper.cpp b/clang/lib/AST/JSONNodeDumper.cpp
index 15e198db46f..24d44cfafe4 100644
--- a/clang/lib/AST/JSONNodeDumper.cpp
+++ b/clang/lib/AST/JSONNodeDumper.cpp
@@ -1026,6 +1026,51 @@ void JSONNodeDumper::VisitCXXConstructExpr(const CXXConstructExpr *CE) {
}
}
+void JSONNodeDumper::VisitExprWithCleanups(const ExprWithCleanups *EWC) {
+ attributeOnlyIfTrue("cleanupsHaveSideEffects",
+ EWC->cleanupsHaveSideEffects());
+ if (EWC->getNumObjects()) {
+ JOS.attributeArray("cleanups", [this, EWC] {
+ for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
+ JOS.value(createBareDeclRef(CO));
+ });
+ }
+}
+
+void JSONNodeDumper::VisitCXXBindTemporaryExpr(
+ const CXXBindTemporaryExpr *BTE) {
+ const CXXTemporary *Temp = BTE->getTemporary();
+ JOS.attribute("temp", createPointerRepresentation(Temp));
+ if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
+ JOS.attribute("dtor", createBareDeclRef(Dtor));
+}
+
+void JSONNodeDumper::VisitMaterializeTemporaryExpr(
+ const MaterializeTemporaryExpr *MTE) {
+ if (const ValueDecl *VD = MTE->getExtendingDecl())
+ JOS.attribute("extendingDecl", createBareDeclRef(VD));
+
+ switch (MTE->getStorageDuration()) {
+ case SD_Automatic:
+ JOS.attribute("storageDuration", "automatic");
+ break;
+ case SD_Dynamic:
+ JOS.attribute("storageDuration", "dynamic");
+ break;
+ case SD_FullExpression:
+ JOS.attribute("storageDuration", "full expression");
+ break;
+ case SD_Static:
+ JOS.attribute("storageDuration", "static");
+ break;
+ case SD_Thread:
+ JOS.attribute("storageDuration", "thread");
+ break;
+ }
+
+ attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
+}
+
void JSONNodeDumper::VisitIntegerLiteral(const IntegerLiteral *IL) {
JOS.attribute("value",
IL->getValue().toString(
OpenPOWER on IntegriCloud