Coverage Report

Created: 2024-09-11 07:09

/src/spirv-tools/source/spirv_optimizer_options.cpp
Line
Count
Source (jump to first uncovered line)
1
// Copyright (c) 2017 Google Inc.
2
//
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
#include <cassert>
16
#include <cstring>
17
18
#include "source/spirv_optimizer_options.h"
19
20
21.1k
SPIRV_TOOLS_EXPORT spv_optimizer_options spvOptimizerOptionsCreate(void) {
21
21.1k
  return new spv_optimizer_options_t();
22
21.1k
}
23
24
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsDestroy(
25
21.1k
    spv_optimizer_options options) {
26
21.1k
  delete options;
27
21.1k
}
28
29
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetRunValidator(
30
0
    spv_optimizer_options options, bool val) {
31
0
  options->run_validator_ = val;
32
0
}
33
34
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetValidatorOptions(
35
21.1k
    spv_optimizer_options options, spv_validator_options val) {
36
21.1k
  options->val_options_ = *val;
37
21.1k
}
38
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetMaxIdBound(
39
21.1k
    spv_optimizer_options options, uint32_t val) {
40
21.1k
  options->max_id_bound_ = val;
41
21.1k
}
42
43
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetPreserveBindings(
44
0
    spv_optimizer_options options, bool val) {
45
0
  options->preserve_bindings_ = val;
46
0
}
47
48
SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetPreserveSpecConstants(
49
0
    spv_optimizer_options options, bool val) {
50
0
  options->preserve_spec_constants_ = val;
51
0
}