• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2/**
3 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// Autogenerated file -- DO NOT EDIT!
18
19#include <array>
20#include <memory>
21#include <unordered_map>
22#include "macros.h"
23#include "source_lang_enum.h"
24#include "verification/plugins.h"
25#include "verification/default_plugin.h"
26<%= Common::include_plugin_files "Verification", "header" %>
27
28// NOLINTBEGIN(fuchsia-statically-constructed-objects)
29namespace ark::verifier::plugin {
30
31% Common::each_plugin_suboption("Verification", "plugin_class") do |plugin_class, plugin_lang|
32// NOLINTNEXTLINE(readability-identifier-naming)
33static <%= plugin_class %> <%= plugin_lang %>_PLUGIN;
34% end
35static DefaultPlugin g_dflt;
36
37static std::unordered_map<panda_file::SourceLang, Plugin const *> const PLUGINS_MAP {
38% Common::each_plugin_suboption("Verification", "plugin_class") do |_, plugin_lang|
39%   short_plugin_lang = plugin_lang == "JAVA" ? "JAVA_8" : plugin_lang
40  { panda_file::SourceLang::<%= short_plugin_lang %>,
41    &<%= plugin_lang %>_PLUGIN },
42% end
43  { panda_file::SourceLang::PANDA_ASSEMBLY, &g_dflt}
44};
45
46// NOLINTEND(fuchsia-statically-constructed-objects)
47Plugin const *GetLanguagePlugin(panda_file::SourceLang lang)
48{
49    if (PLUGINS_MAP.count(lang) > 0) {
50        return PLUGINS_MAP.at(lang);
51    }
52    return &g_dflt;
53}
54
55} // namespace ark::verifier::plugin
56