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