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 // For future additions. 83 optional string referenced_type = 1; 84 optional uint64 field_offset = 2; 85 optional string field_name = 3; 86 optional AccessSpecifier access = 4 [default = public_access]; 87} 88 89message EnumFieldDecl { 90 optional int64 enum_field_value = 1; // assumption: fits int64 91 optional string name = 3; 92} 93 94message TemplateInfo { 95 repeated TemplateElement elements = 1; 96} 97 98message TemplateElement { 99 optional string referenced_type = 1; 100} 101 102message CXXBaseSpecifier { 103 optional string referenced_type = 1; 104 optional bool is_virtual = 2; 105 optional AccessSpecifier access = 3; 106} 107 108message VTableComponent { 109 enum Kind { 110 VCallOffset = 0; 111 VBaseOffset = 1; 112 OffsetToTop = 2; 113 RTTI = 3; 114 FunctionPointer = 4; 115 CompleteDtorPointer = 5; 116 DeletingDtorPointer = 6; 117 UnusedFunctionPointer = 7; 118 } 119 optional Kind kind = 1; 120 optional string mangled_component_name = 2 [default = ""]; 121 // Maintain backwards compatibility. Builds don't break while updating 122 // reference dumps. TODO: b/63081517 123 optional uint64 value = 3 [default = 0]; 124 optional int64 component_value = 4 [default = 0]; 125 optional bool is_pure = 6 [default = false]; 126} 127 128message VTableLayout { 129 repeated VTableComponent vtable_components = 1; 130} 131 132message RecordType { 133 optional BasicNamedAndTypedDecl type_info = 1; 134 repeated RecordFieldDecl fields = 2; 135 repeated CXXBaseSpecifier base_specifiers = 3; 136 optional TemplateInfo template_info = 5; 137 optional VTableLayout vtable_layout = 7; 138 optional AccessSpecifier access = 8 [default = public_access]; 139 optional bool is_anonymous = 9; 140 optional RecordKind record_kind = 10 [default = struct_kind]; 141} 142 143message EnumType { 144 optional BasicNamedAndTypedDecl type_info = 1; 145 optional string underlying_type = 2; 146 repeated EnumFieldDecl enum_fields = 3; 147 optional AccessSpecifier access = 4 [default = public_access]; 148} 149 150message GlobalVarDecl { 151 optional string name = 1; 152 optional string source_file = 2; 153 optional string linker_set_key = 3; 154 optional string referenced_type = 4; 155 optional AccessSpecifier access = 5 [default = public_access]; 156} 157 158enum ElfSymbolBinding { 159 Global = 1; 160 Weak = 2; 161} 162 163message ElfFunction { 164 optional string name = 1; 165 optional ElfSymbolBinding binding = 2; 166} 167 168message ElfObject { 169 optional string name = 1; 170 optional ElfSymbolBinding binding = 2; 171} 172 173message TranslationUnit { 174 repeated RecordType record_types = 1; 175 repeated EnumType enum_types = 2; 176 repeated PointerType pointer_types = 3; 177 repeated LvalueReferenceType lvalue_reference_types = 4; 178 repeated RvalueReferenceType rvalue_reference_types = 5; 179 repeated BuiltinType builtin_types = 6; 180 repeated QualifiedType qualified_types = 7; 181 repeated ArrayType array_types = 8; 182 repeated FunctionType function_types = 13; 183 repeated FunctionDecl functions = 9; 184 repeated GlobalVarDecl global_vars = 10; 185 repeated ElfFunction elf_functions = 11; 186 repeated ElfObject elf_objects = 12; 187} 188