Raw dump of lang tree was missing information about virtual method call.
The information is provided in "tok" field of obj_type_ref.
gcc/ChangeLog:
* tree-dump.cc (dequeue_and_dump): Handle OBJ_TYPE_REF.
gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/lang-dump-1.C: New test.
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-fdump-lang-raw" }
+// Check if dump file contains OBJ_TYPE_REF with additional fields (information about called virtual method).
+
+class VExample {
+public:
+ virtual void methodV1() {}
+ virtual void methodV2() {}
+};
+
+void funcA() {
+ VExample objA;
+ VExample *ptrA = &objA;
+
+ ptrA->methodV2();
+ ptrA->methodV1();
+}
+
+// { dg-final { scan-lang-dump-times {obj_type_ref[^\n]*type:} 2 raw } }
+// { dg-final { scan-lang-dump-times {obj_type_ref[^\n]*expr:} 2 raw } }
+// { dg-final { scan-lang-dump-times {obj_type_ref[^\n]*obj :} 2 raw } }
+// { dg-final { scan-lang-dump-times {obj_type_ref[^\n]*\n[^\n]*tok :} 2 raw } }
dump_child ("op: ", OMP_CLAUSE_OPERAND (t, i));
}
break;
+
+ case OBJ_TYPE_REF:
+ dump_child ("expr", OBJ_TYPE_REF_EXPR (t));
+ dump_child ("obj", OBJ_TYPE_REF_OBJECT (t));
+ dump_child ("tok", OBJ_TYPE_REF_TOKEN (t));
+ break;
+
default:
/* There are no additional fields to print. */
break;