1# Copyright (c) 2021-2022 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 14 15set(CODEGEN_VISITORS_INC ${PANDA_BINARY_ROOT}/bytecode_optimizer/generated/codegen_visitors.inc) 16panda_gen_file( 17 DATAFILE ${GEN_PLUGIN_OPTIONS_YAML} 18 TEMPLATE ${PANDA_ROOT}/bytecode_optimizer/templates/codegen_visitors.inc.erb 19 REQUIRES ${PANDA_ROOT}/templates/plugin_options.rb 20 EXTRA_DEPENDENCIES plugin_options_merge 21 OUTPUTFILE ${CODEGEN_VISITORS_INC} 22) 23 24add_custom_target(bytecode_optimizer_codegen_visitors_inc DEPENDS 25 plugin_options_gen 26 ${CODEGEN_VISITORS_INC} 27) 28 29set(REG_ENCODER_VISITORS_INC ${PANDA_BINARY_ROOT}/bytecode_optimizer/generated/reg_encoder_visitors.inc) 30panda_gen_file( 31 DATAFILE ${GEN_PLUGIN_OPTIONS_YAML} 32 TEMPLATE ${PANDA_ROOT}/bytecode_optimizer/templates/reg_encoder_visitors.inc.erb 33 REQUIRES ${PANDA_ROOT}/templates/plugin_options.rb 34 EXTRA_DEPENDENCIES plugin_options_merge 35 OUTPUTFILE ${REG_ENCODER_VISITORS_INC} 36) 37 38add_custom_target(bytecode_optimizer_reg_encoder_visitors_inc DEPENDS 39 plugin_options_gen 40 ${REG_ENCODER_VISITORS_INC} 41) 42 43set(CODEGEN_INTRINSICS_CPP ${PANDA_BINARY_ROOT}/bytecode_optimizer/generated/codegen_intrinsics.cpp) 44panda_gen_file( 45 DATAFILE ${GEN_PLUGIN_OPTIONS_YAML} 46 TEMPLATE ${PANDA_ROOT}/bytecode_optimizer/templates/codegen_intrinsics.cpp.erb 47 REQUIRES ${PANDA_ROOT}/templates/plugin_options.rb 48 EXTRA_DEPENDENCIES plugin_options_merge 49 OUTPUTFILE ${CODEGEN_INTRINSICS_CPP} 50) 51 52add_custom_target(bytecode_optimizer_codegen_intrinsics_cpp DEPENDS 53 plugin_options_gen 54 ${CODEGEN_INTRINSICS_CPP} 55) 56 57add_dependencies(arkbytecodeopt 58 bytecode_optimizer_codegen_visitors_inc 59 bytecode_optimizer_reg_encoder_visitors_inc 60 bytecode_optimizer_codegen_intrinsics_cpp 61) 62