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