Update path-to-regexp to address CVE-2024-45296 (#5895)
[KhronosGroup/SPIRV-Tools.git] / source / spirv_optimizer_options.cpp
blobe92ffc0f42c259a76d16415b0bb419abceac9276
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.
15 #include <cassert>
16 #include <cstring>
18 #include "source/spirv_optimizer_options.h"
20 SPIRV_TOOLS_EXPORT spv_optimizer_options spvOptimizerOptionsCreate(void) {
21 return new spv_optimizer_options_t();
24 SPIRV_TOOLS_EXPORT void spvOptimizerOptionsDestroy(
25 spv_optimizer_options options) {
26 delete options;
29 SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetRunValidator(
30 spv_optimizer_options options, bool val) {
31 options->run_validator_ = val;
34 SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetValidatorOptions(
35 spv_optimizer_options options, spv_validator_options val) {
36 options->val_options_ = *val;
38 SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetMaxIdBound(
39 spv_optimizer_options options, uint32_t val) {
40 options->max_id_bound_ = val;
43 SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetPreserveBindings(
44 spv_optimizer_options options, bool val) {
45 options->preserve_bindings_ = val;
48 SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetPreserveSpecConstants(
49 spv_optimizer_options options, bool val) {
50 options->preserve_spec_constants_ = val;