-
Notifications
You must be signed in to change notification settings - Fork 0
GCC tree dump dequeue_and_dump
James Michael DuPont edited this page May 13, 2017
·
1 revision
Finding the switch statement :
g.V("field_decl").In("nodetype")
.Tag("field")
.Out("scpe").Out("name").Out("name").Has("strg","tree_base")
.Back("field").Out("name").Has("strg","code")
.Back("field")
.In("op_1").Has("nodetype","component_ref")
.In("op_0").Has("nodetype","eq_expr")
.In("op_0").Has("nodetype","cond_expr")
.In([],"numeric_field") .Has("nodetype","statement_list") // special statement list
.In("body").Has("nodetype","bind_expr")
.In("body").Has("nodetype","switch_expr")
.In([],"numeric_field2") .Has("nodetype","statement_list") // special statement list
.In("body").Has("nodetype","bind_expr")
.In([],"numeric_field3") .Has("nodetype","statement_list") // special statement list
.In("body").Has("nodetype","bind_expr")
.In("body","body").Has("nodetype","function_decl").Tag("decl")
.Back("decl").Out("name").Out("strg").Tag("name")
.Back('decl').Out(["srcp"],"SourceFile")
.All()
{"result":[{"SourceFile":"srcp","body":"body","decl":"@59","field":"@660","id":"tree-dump.c:247","name":"dequeue_and_dump","numeric_field":"51","numeric_field2":"0","numeric_field3":"27"},{"SourceFile":"srcp","body":"body","decl":"@59","field":"@660","id":"tree-dump.c:247","name":"dequeue_and_dump","numeric_field":"65","numeric_field2":"0","numeric_field3":"27"},{"SourceFile":"srcp","body":"body","decl":"@59","field":"@660","id":"tree-dump.c:247","name":"dequeue_and_dump","numeric_field":"68","numeric_field2":"0","numeric_field3":"27"}]}
https://github.com/gcc-mirror/gcc/blob/23796153cce409ff9e9615d03a82263e4dab88c4/gcc/tree-dump.c#L405