1/** 2 * Copyright (c) 2024 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// Autogenerated file -- DO NOT EDIT! 17 18<%= Common::include_plugin_files "bytecodeopt", "codegen_visitors_inc" %> 19 20<%plugins_overrides = Hash.new() 21 Common::each_plugin_suboption("bytecodeopt", "codegen_visitors_overrides") do |codegen_visitors_overrides, plugin_lang| 22 codegen_visitors_overrides.each do |visitor| 23 plugins_overrides[visitor].nil? ? plugins_overrides[visitor] = [].append(plugin_lang) 24 : plugins_overrides[visitor].append(plugin_lang) 25 end 26 end 27 ["LoadObject", "LoadStatic", "StoreObject", "StoreStatic"].each do |visitor|%> 28static bool TryPlugin<%= visitor %>Visitor(GraphVisitor *v, [[maybe_unused]] Inst *inst) { 29 [[maybe_unused]] auto lang = static_cast<CodeGenStatic*>(v)->GetGraph()->GetLanguage(); 30% if plugins_overrides[visitor] 31% plugins_overrides[visitor].each do |lang| 32 if (lang == <%= Common::plugins[lang]["lang_enum"] %>) { 33 return <%= lang.capitalize %>Visit<%= visitor %>(v, inst); 34 } 35% end 36% end 37 return false; 38} 39% end 40