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  optional bool is_pure = 6 [default = false];
125}
126
127message VTableLayout {
128  repeated VTableComponent vtable_components = 1;
129}
130
131message RecordType {
132  optional BasicNamedAndTypedDecl type_info = 1;
133  repeated RecordFieldDecl fields = 2;
134  repeated CXXBaseSpecifier base_specifiers = 3;
135  optional TemplateInfo template_info = 5;
136  optional VTableLayout vtable_layout = 7;
137  optional AccessSpecifier access = 8 [default = public_access];
138  optional bool is_anonymous = 9;
139  optional RecordKind record_kind = 10 [default = struct_kind];
140}
141
142message EnumType {
143  optional BasicNamedAndTypedDecl type_info = 1;
144  optional string underlying_type = 2;
145  repeated EnumFieldDecl enum_fields = 3;
146  optional AccessSpecifier access = 4 [default = public_access];
147}
148
149message GlobalVarDecl {
150  optional string name = 1;
151  optional string source_file = 2;
152  optional string linker_set_key = 3;
153  optional string referenced_type = 4;
154  optional AccessSpecifier access = 5 [default = public_access];
155}
156
157enum ElfSymbolBinding {
158  Global = 1;
159  Weak = 2;
160}
161
162message ElfFunction {
163  optional string name = 1;
164  optional ElfSymbolBinding binding = 2;
165}
166
167message ElfObject {
168  optional string name = 1;
169  optional ElfSymbolBinding binding = 2;
170}
171
172message TranslationUnit {
173  repeated RecordType record_types = 1;
174  repeated EnumType enum_types = 2;
175  repeated PointerType pointer_types = 3;
176  repeated LvalueReferenceType lvalue_reference_types = 4;
177  repeated RvalueReferenceType rvalue_reference_types = 5;
178  repeated BuiltinType builtin_types = 6;
179  repeated QualifiedType qualified_types = 7;
180  repeated ArrayType array_types = 8;
181  repeated FunctionType function_types = 13;
182  repeated FunctionDecl functions = 9;
183  repeated GlobalVarDecl global_vars = 10;
184  repeated ElfFunction elf_functions = 11;
185  repeated ElfObject elf_objects = 12;
186}
187