• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef MERGE_ABC_ASSEMBLY_FUNCTION_H
17 #define MERGE_ABC_ASSEMBLY_FUNCTION_H
18 
19 #include "arena_allocator.h"
20 #include "assemblyDebugProto.h"
21 #include "assemblyFileLocationProto.h"
22 #include "assemblyFunction.pb.h"
23 #include "assemblyInsProto.h"
24 #include "assemblyLabelProto.h"
25 #include "assemblyTypeProto.h"
26 #include "assembly-program.h"
27 #include "ideHelpersProto.h"
28 #include "metaProto.h"
29 
30 namespace panda::proto {
31 class CatchBlock {
32 public:
33     static void Serialize(const panda::pandasm::Function::CatchBlock &block, protoPanda::CatchBlock &protoBlock);
34     static void Deserialize(const protoPanda::CatchBlock &protoBlock, panda::pandasm::Function::CatchBlock &block);
35 };
36 
37 class Parameter {
38 public:
39     static void Serialize(const panda::pandasm::Function::Parameter &param, protoPanda::Parameter &protoParam);
40 };
41 
42 class Function {
43 public:
44     static void Serialize(const panda::pandasm::Function &function, protoPanda::Function &protoFunction);
45     static void DeserializeLabels(const protoPanda::Function &protoFunction, panda::pandasm::Function &function,
46                                   panda::ArenaAllocator *allocator);
47     static void DeserializeProtoIns(const protoPanda::Function &protoFunction, panda::pandasm::Function &function,
48                                     panda::ArenaAllocator *allocator);
49     static void DeserializeProtoLocalVariable(const protoPanda::Function &protoFunction,
50                                               panda::pandasm::Function &function,
51                                               panda::ArenaAllocator *allocator);
52     static void Deserialize(const protoPanda::Function &protoFunction, panda::pandasm::Function &function,
53                             panda::ArenaAllocator *allocator);
54 };
55 } // panda::proto
56 #endif
57