• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14set(INTRINSICS_CODEGEN_EXT_INL_H ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_codegen_ext.inl.h)
15panda_gen_file(
16    DATA ${GEN_PLUGIN_OPTIONS_YAML}
17    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_codegen_ext.inl.h.erb
18    API ${PANDA_ROOT}/templates/plugin_options.rb
19    EXTRA_DEPENDENCIES plugin_options_merge
20    OUTPUTFILE ${INTRINSICS_CODEGEN_EXT_INL_H}
21)
22
23set(INTRINSICS_IR_BUILD_STATIC_CALL_INL ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_ir_build_static_call.inl)
24panda_gen_file(
25    DATA ${GEN_PLUGIN_OPTIONS_YAML}
26    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_ir_build_static_call.inl.erb
27    API ${PANDA_ROOT}/templates/plugin_options.rb
28    EXTRA_DEPENDENCIES plugin_options_merge
29    OUTPUTFILE ${INTRINSICS_IR_BUILD_STATIC_CALL_INL}
30)
31
32set(INTRINSICS_IR_BUILD_VIRTUAL_CALL_INL ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_ir_build_virtual_call.inl)
33panda_gen_file(
34    DATA ${GEN_PLUGIN_OPTIONS_YAML}
35    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_ir_build_virtual_call.inl.erb
36    API ${PANDA_ROOT}/templates/plugin_options.rb
37    EXTRA_DEPENDENCIES plugin_options_merge
38    OUTPUTFILE ${INTRINSICS_IR_BUILD_VIRTUAL_CALL_INL}
39)
40
41set(INTRINSICS_GRAPH_CHECKER_INL ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_graph_checker.inl)
42panda_gen_file(
43    DATA ${GEN_PLUGIN_OPTIONS_YAML}
44    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_graph_checker.inl.erb
45    API ${PANDA_ROOT}/templates/plugin_options.rb
46    EXTRA_DEPENDENCIES plugin_options_merge
47    OUTPUTFILE ${INTRINSICS_GRAPH_CHECKER_INL}
48)
49
50set(INTRINSICS_IR_BUILD_INL_H ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_ir_build.inl.h)
51panda_gen_file(
52    DATA ${GEN_PLUGIN_OPTIONS_YAML}
53    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_ir_build.inl.h.erb
54    API ${PANDA_ROOT}/templates/plugin_options.rb
55    EXTRA_DEPENDENCIES plugin_options_merge
56    OUTPUTFILE ${INTRINSICS_IR_BUILD_INL_H}
57)
58
59set(INTRINSICS_CAN_ENCODE_INL ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_can_encode.inl)
60panda_gen_file(
61    DATA ${GEN_PLUGIN_OPTIONS_YAML}
62    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_can_encode.inl.erb
63    API ${PANDA_ROOT}/templates/plugin_options.rb
64    EXTRA_DEPENDENCIES plugin_options_merge
65    OUTPUTFILE ${INTRINSICS_CAN_ENCODE_INL}
66)
67
68set(INTRINSICS_LSE_HEAP_INV_ARGS_INL ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_lse_heap_inv_args.inl)
69panda_gen_file(
70    DATA ${GEN_PLUGIN_OPTIONS_YAML}
71    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_lse_heap_inv_args.inl.erb
72    API ${PANDA_ROOT}/templates/plugin_options.rb
73    EXTRA_DEPENDENCIES plugin_options_merge
74    OUTPUTFILE ${INTRINSICS_LSE_HEAP_INV_ARGS_INL}
75)
76
77set(IR_DYN_BASE_TYPES_H ${PANDA_BINARY_ROOT}/compiler/generated/ir-dyn-base-types.h)
78panda_gen_file(
79    DATA ${GEN_PLUGIN_OPTIONS_YAML}
80    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/ir-dyn-base-types.h.erb
81    API ${PANDA_ROOT}/templates/plugin_options.rb
82    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
83    OUTPUTFILE ${IR_DYN_BASE_TYPES_H}
84)
85
86add_custom_target(ir_dyn_base_types_h DEPENDS ${IR_DYN_BASE_TYPES_H})
87
88set(SOURCE_LANGUAGES_H ${PANDA_BINARY_ROOT}/compiler/generated/source_languages.h)
89panda_gen_file(
90    DATA ${GEN_PLUGIN_OPTIONS_YAML}
91    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/source_languages.h.erb
92    API ${PANDA_ROOT}/templates/plugin_options.rb
93    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
94    OUTPUTFILE ${SOURCE_LANGUAGES_H}
95)
96
97add_custom_target(source_languages_h DEPENDS ${SOURCE_LANGUAGES_H})
98
99set(CODEGEN_LANGUAGE_EXTENSIONS_H ${PANDA_BINARY_ROOT}/compiler/generated/codegen_language_extensions.h)
100panda_gen_file(
101    DATA ${GEN_PLUGIN_OPTIONS_YAML}
102    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/codegen_language_extensions.h.erb
103    API ${PANDA_ROOT}/templates/plugin_options.rb
104    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
105    OUTPUTFILE ${CODEGEN_LANGUAGE_EXTENSIONS_H}
106)
107
108set(COMPILER_INTERFACE_EXTENSIONS_H ${PANDA_BINARY_ROOT}/compiler/generated/compiler_interface_extensions.inl.h)
109panda_gen_file(
110    DATA ${GEN_PLUGIN_OPTIONS_YAML}
111    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/compiler_interface_extensions.inl.h.erb
112    API ${PANDA_ROOT}/templates/plugin_options.rb
113    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
114    OUTPUTFILE ${COMPILER_INTERFACE_EXTENSIONS_H}
115)
116
117set(IRTOC_INTERFACE_EXTENSIONS_H ${PANDA_BINARY_ROOT}/compiler/generated/irtoc_interface_extensions.inl.h)
118panda_gen_file(
119    DATA ${GEN_PLUGIN_OPTIONS_YAML}
120    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/irtoc_interface_extensions.inl.h.erb
121    API ${PANDA_ROOT}/templates/plugin_options.rb
122    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
123    OUTPUTFILE ${IRTOC_INTERFACE_EXTENSIONS_H}
124)
125
126set(IRTOC_INTERFACE_EXTENSIONS_INCLUDES_H ${PANDA_BINARY_ROOT}/compiler/generated/irtoc_interface_extensions_includes.inl.h)
127panda_gen_file(
128    DATA ${GEN_PLUGIN_OPTIONS_YAML}
129    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/irtoc_interface_extensions_includes.inl.h.erb
130    API ${PANDA_ROOT}/templates/plugin_options.rb
131    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
132    OUTPUTFILE ${IRTOC_INTERFACE_EXTENSIONS_INCLUDES_H}
133)
134
135set(INST_BUILDER_EXTENSIONS_H ${PANDA_BINARY_ROOT}/compiler/generated/inst_builder_extensions.inl.h)
136panda_gen_file(
137    DATA ${GEN_PLUGIN_OPTIONS_YAML}
138    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/inst_builder_extensions.inl.h.erb
139    API ${PANDA_ROOT}/templates/plugin_options.rb
140    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
141    OUTPUTFILE ${INST_BUILDER_EXTENSIONS_H}
142)
143
144set(INTRINSICS_EXTENSIONS_H ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_extensions.inl.h)
145panda_gen_file(
146    DATA ${GEN_PLUGIN_OPTIONS_YAML}
147    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics_extensions.inl.h.erb
148    API ${PANDA_ROOT}/templates/plugin_options.rb
149    EXTRA_DEPENDENCIES ${YAML_FILES} plugin_options_merge
150    OUTPUTFILE ${INTRINSICS_EXTENSIONS_H}
151)
152
153set(INTRINSICS_INLINE_INL_H ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_inline.inl.h)
154panda_gen_file(
155    DATA ${GEN_PLUGIN_OPTIONS_YAML}
156    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_inline.inl.h.erb
157    API ${PANDA_ROOT}/templates/plugin_options.rb
158    EXTRA_DEPENDENCIES plugin_options_merge
159    OUTPUTFILE ${INTRINSICS_INLINE_INL_H}
160)
161set(INTRINSICS_INLINE_NATIVE_METHOD_INL ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_inline_native_method.inl)
162panda_gen_file(
163    DATA ${GEN_PLUGIN_OPTIONS_YAML}
164    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_inline_native_method.inl.erb
165    API ${PANDA_ROOT}/templates/plugin_options.rb
166    EXTRA_DEPENDENCIES plugin_options_merge
167    OUTPUTFILE ${INTRINSICS_INLINE_NATIVE_METHOD_INL}
168)
169
170set(INTRINSICS_PEEPHOLE_INL_H ${PANDA_BINARY_ROOT}/compiler/generated/intrinsics_peephole.inl.h)
171panda_gen_file(
172    DATA ${GEN_PLUGIN_OPTIONS_YAML}
173    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/intrinsics/intrinsics_peephole.inl.h.erb
174    API ${PANDA_ROOT}/templates/plugin_options.rb
175    EXTRA_DEPENDENCIES plugin_options_merge
176    OUTPUTFILE ${INTRINSICS_PEEPHOLE_INL_H}
177)
178
179set(PIPELINE_INCLUDES_H ${PANDA_BINARY_ROOT}/compiler/generated/pipeline_includes.h)
180panda_gen_file(
181    DATA ${GEN_PLUGIN_OPTIONS_YAML}
182    TEMPLATE ${PANDA_ROOT}/compiler/optimizer/templates/pipeline_includes.h.erb
183    API ${PANDA_ROOT}/templates/plugin_options.rb
184    EXTRA_DEPENDENCIES plugin_options_merge
185    OUTPUTFILE ${PIPELINE_INCLUDES_H}
186)
187
188add_custom_target(compiler_intrinsics DEPENDS
189    plugin_options_gen
190    ${INTRINSICS_CODEGEN_EXT_INL_H}
191    ${INTRINSICS_IR_BUILD_STATIC_CALL_INL}
192    ${INTRINSICS_IR_BUILD_VIRTUAL_CALL_INL}
193    ${INTRINSICS_IR_BUILD_INL_H}
194    ${INTRINSICS_CAN_ENCODE_INL}
195    ${INTRINSICS_LSE_HEAP_INV_ARGS_INL}
196    ${IR_DYN_BASE_TYPES_H}
197    ${SOURCE_LANGUAGES_H}
198    ${CODEGEN_LANGUAGE_EXTENSIONS_H}
199    ${COMPILER_INTERFACE_EXTENSIONS_H}
200    ${IRTOC_INTERFACE_EXTENSIONS_H}
201    ${IRTOC_INTERFACE_EXTENSIONS_INCLUDES_H}
202    ${INST_BUILDER_EXTENSIONS_H}
203    ${INTRINSICS_EXTENSIONS_H}
204    ${INTRINSICS_INLINE_INL_H}
205    ${INTRINSICS_GRAPH_CHECKER_INL}
206    ${INTRINSICS_INLINE_NATIVE_METHOD_INL}
207    ${INTRINSICS_PEEPHOLE_INL_H}
208    ${PIPELINE_INCLUDES_H}
209)
210
211add_dependencies(arkcompiler compiler_intrinsics)
212add_dependencies(panda_gen_files compiler_intrinsics)
213