Lines Matching defs:protoFunction
54 void Function::Serialize(const panda::pandasm::Function &function, protoPanda::Function &protoFunction)
56 protoFunction.set_name(function.name);
57 protoFunction.set_language(static_cast<uint32_t>(function.language));
59 auto *protoFuncMeta = protoFunction.mutable_metadata();
63 auto *labelMap = protoFunction.add_labeltable();
70 auto *protoIns = protoFunction.add_ins();
75 auto *protoDebug = protoFunction.add_localvariabledebug();
79 protoFunction.set_sourcefile(function.source_file);
80 protoFunction.set_sourcecode(function.source_code);
83 auto *protoBlock = protoFunction.add_catchblocks();
87 protoFunction.set_valueoffirstparam(function.value_of_first_param);
88 protoFunction.set_regsnum(function.regs_num);
91 auto *protoParam = protoFunction.add_params();
95 protoFunction.set_bodypresence(function.body_presence);
97 auto *protoReturnType = protoFunction.mutable_returntype();
100 auto *protoBodyLocation = protoFunction.mutable_bodylocation();
105 auto *protoFileLocation = protoFunction.mutable_filelocation();
108 protoFunction.set_function_kind(static_cast<uint8_t>(function.function_kind));
109 protoFunction.set_slotsnum(function.slots_num);
112 protoFunction.add_concurrent_module_requests(moduleRequestId);
116 void Function::DeserializeLabels(const protoPanda::Function &protoFunction, panda::pandasm::Function &function,
119 function.label_table.reserve(protoFunction.labeltable_size());
120 for (const auto &labelUnit : protoFunction.labeltable()) {
129 void Function::DeserializeProtoIns(const protoPanda::Function &protoFunction, panda::pandasm::Function &function,
132 function.ins.reserve(protoFunction.ins_size());
133 for (const auto &protoIns : protoFunction.ins()) {
140 void Function::DeserializeProtoLocalVariable(const protoPanda::Function &protoFunction,
144 function.local_variable_debug.reserve(protoFunction.localvariabledebug_size());
145 for (const auto &protoLocalVariable : protoFunction.localvariabledebug()) {
152 void Function::Deserialize(const protoPanda::Function &protoFunction, panda::pandasm::Function &function,
155 FunctionMetadata::Deserialize(protoFunction.metadata(), function.metadata, allocator);
156 DeserializeLabels(protoFunction, function, allocator);
157 DeserializeProtoIns(protoFunction, function, allocator);
158 DeserializeProtoLocalVariable(protoFunction, function, allocator);
160 function.source_file = protoFunction.sourcefile();
161 function.source_code = protoFunction.sourcecode();
163 function.catch_blocks.reserve(protoFunction.catchblocks_size());
164 for (const auto &protoCatchBlock : protoFunction.catchblocks()) {
171 function.value_of_first_param = protoFunction.valueoffirstparam();
172 function.regs_num = protoFunction.regsnum();
174 function.params.reserve(protoFunction.params_size());
175 for (const auto &protoParam : protoFunction.params()) {
182 function.body_presence = protoFunction.bodypresence();
183 function.return_type = Type::Deserialize(protoFunction.returntype(), allocator);
184 SourceLocation::Deserialize(protoFunction.bodylocation(), function.body_location);
186 if (protoFunction.has_filelocation()) {
187 FileLocation::Deserialize(protoFunction.filelocation(), function.file_location);
189 function.SetFunctionKind(static_cast<panda::panda_file::FunctionKind>(protoFunction.function_kind()));
190 function.SetSlotsNum(protoFunction.slotsnum());
192 for (const auto &moduleRequestId : protoFunction.concurrent_module_requests()) {