Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2017 WebAssembly Community Group participants |
3 | | * |
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 | | #include "wabt/feature.h" |
18 | | |
19 | | #include "wabt/option-parser.h" |
20 | | |
21 | | namespace wabt { |
22 | | |
23 | 0 | void Features::AddOptions(OptionParser* parser) { |
24 | 0 | #define WABT_FEATURE(variable, flag, default_, help) \ |
25 | 0 | if (default_ == true) { \ |
26 | 0 | parser->AddOption("disable-" flag, "Disable " help, \ |
27 | 0 | [this]() { disable_##variable(); }); \ Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_1::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_2::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_3::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_4::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_7::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_9::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_10::operator()() const |
28 | 0 | } else { \ |
29 | 0 | parser->AddOption("enable-" flag, "Enable " help, \ |
30 | 0 | [this]() { enable_##variable(); }); \ Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_0::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_5::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_6::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_8::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_11::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_12::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_13::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_14::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_15::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_16::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_17::operator()() const Unexecuted instantiation: feature.cc:wabt::Features::AddOptions(wabt::OptionParser*)::$_18::operator()() const |
31 | 0 | } |
32 | |
|
33 | 0 | #include "wabt/feature.def" |
34 | 0 | #undef WABT_FEATURE |
35 | 0 | parser->AddOption("enable-all", "Enable all features", |
36 | 0 | [this]() { EnableAll(); }); |
37 | 0 | } |
38 | | |
39 | 1.49M | void Features::UpdateDependencies() { |
40 | | // Exception handling requires reference types. |
41 | 1.49M | if (exceptions_enabled_) { |
42 | 1.43M | reference_types_enabled_ = true; |
43 | 1.43M | } |
44 | | |
45 | | // Function references require reference types. |
46 | 1.49M | if (function_references_enabled_) { |
47 | 974k | reference_types_enabled_ = true; |
48 | 974k | } |
49 | | |
50 | | // Reference types requires bulk memory. |
51 | 1.49M | if (!bulk_memory_enabled_) { |
52 | 0 | reference_types_enabled_ = false; |
53 | 0 | } |
54 | 1.49M | } |
55 | | |
56 | | } // namespace wabt |