1syntax = "proto2";
2
3package abi_dump;
4
5enum AccessSpecifier {
6  public_access = 1;
7  private_access = 2;
8  protected_access = 3;
9}
10
11enum RecordKind {
12  struct_kind = 1;
13  class_kind = 2;
14  union_kind = 3;
15}
16
17message BasicNamedAndTypedDecl {
18  // The TypedDecl's name.
19  optional string name = 1;
20  optional uint64 size = 2 [default = 0];
21  optional uint32 alignment = 3 [default = 0];
22  optional string referenced_type = 4;
23  optional string source_file = 5;
24  optional string linker_set_key = 6;
25  optional string self_type = 7;
26}
27
28message ArrayType {
29  optional BasicNamedAndTypedDecl type_info = 1;
30}
31
32message PointerType {
33  optional BasicNamedAndTypedDecl type_info = 1;
34}
35
36message QualifiedType {
37  optional BasicNamedAndTypedDecl type_info = 1;
38  optional bool is_const = 6;
39  optional bool is_volatile = 7;
40  optional bool is_restricted = 8;
41}
42
43message BuiltinType {
44  optional BasicNamedAndTypedDecl type_info = 1;
45  optional bool is_unsigned = 2;
46  optional bool is_integral = 3;
47}
48
49message LvalueReferenceType {
50  optional BasicNamedAndTypedDecl type_info = 1;
51}
52
53message RvalueReferenceType {
54  optional BasicNamedAndTypedDecl type_info = 1;
55}
56
57message FunctionType {
58  optional BasicNamedAndTypedDecl type_info = 1;
59  optional string return_type = 2;
60  repeated ParamDecl parameters = 3;
61}
62
63message FunctionDecl {
64  // Return type reference
65  optional string return_type = 1;
66  optional string function_name = 2;
67  optional string source_file = 3;
68  repeated ParamDecl parameters = 4;
69  optional TemplateInfo template_info = 5;
70  optional string linker_set_key = 6;
71  optional AccessSpecifier access = 7 [default = public_access];
72}
73
74message ParamDecl {
75  optional string referenced_type = 1;
76  optional bool default_arg = 2;
77  optional bool is_this_ptr = 3;
78}
79
80message RecordFieldDecl {
81  // For future additions.
82  optional string referenced_type = 1;
83  optional uint64 field_offset = 2;
84  optional string field_name = 3;
85  optional AccessSpecifier access = 4 [default = public_access];
86}
87
88message EnumFieldDecl {
89  optional int64 enum_field_value = 1; // assumption: fits int64
90  optional string name = 3;
91}
92
93message TemplateInfo {
94  repeated TemplateElement elements = 1;
95}
96
97message TemplateElement {
98  optional string referenced_type = 1;
99}
100
101message CXXBaseSpecifier {
102  optional string referenced_type = 1;
103  optional bool is_virtual = 2;
104  optional AccessSpecifier access = 3;
105}
106
107message VTableComponent {
108  enum Kind {
109    VCallOffset = 0;
110    VBaseOffset = 1;
111    OffsetToTop = 2;
112    RTTI = 3;
113    FunctionPointer = 4;
114    CompleteDtorPointer = 5;
115    DeletingDtorPointer = 6;
116    UnusedFunctionPointer = 7;
117  }
118  optional Kind kind = 1;
119  optional string mangled_component_name = 2 [default = ""];
120  // Maintain backwards compatibility. Builds don't break while updating
121  // reference dumps. TODO: b/63081517
122  optional uint64 value = 3 [default = 0];
123  optional int64 component_value = 4 [default = 0];
124}
125
126message VTableLayout {
127  repeated VTableComponent vtable_components = 1;
128}
129
130message TagType {
131  optional string unique_id = 1 [default = ""];
132}
133
134message RecordType {
135  optional BasicNamedAndTypedDecl type_info = 1;
136  repeated RecordFieldDecl fields = 2;
137  repeated CXXBaseSpecifier base_specifiers = 3;
138  optional TemplateInfo template_info = 5;
139  optional VTableLayout vtable_layout = 7;
140  optional AccessSpecifier access = 8 [default = public_access];
141  optional bool is_anonymous = 9;
142  optional RecordKind record_kind = 10 [default = struct_kind];
143  optional TagType tag_info = 11;
144}
145
146message EnumType {
147  optional BasicNamedAndTypedDecl type_info = 1;
148  optional string underlying_type = 2;
149  repeated EnumFieldDecl enum_fields = 3;
150  optional AccessSpecifier access = 4 [default = public_access];
151  optional TagType tag_info = 5;
152}
153
154message GlobalVarDecl {
155  optional string name = 1;
156  optional string source_file = 2;
157  optional string linker_set_key = 3;
158  optional string referenced_type = 4;
159  optional AccessSpecifier access = 5 [default = public_access];
160}
161
162message ElfFunction {
163  optional string name = 1;
164}
165
166message ElfObject {
167  optional string name = 1;
168}
169
170message TranslationUnit {
171  repeated RecordType record_types = 1;
172  repeated EnumType enum_types = 2;
173  repeated PointerType pointer_types = 3;
174  repeated LvalueReferenceType lvalue_reference_types = 4;
175  repeated RvalueReferenceType rvalue_reference_types = 5;
176  repeated BuiltinType builtin_types = 6;
177  repeated QualifiedType qualified_types = 7;
178  repeated ArrayType array_types = 8;
179  repeated FunctionType function_types = 13;
180  repeated FunctionDecl functions = 9;
181  repeated GlobalVarDecl global_vars = 10;
182  repeated ElfFunction elf_functions = 11;
183  repeated ElfObject elf_objects = 12;
184}
185