diff --git a/source/spirv_reducer_options.cpp b/source/spirv_reducer_options.cpp index 0426800e..5801d0a1 100644 --- a/source/spirv_reducer_options.cpp +++ b/source/spirv_reducer_options.cpp @@ -17,6 +17,14 @@ #include "source/spirv_reducer_options.h" +namespace { +// The default maximum number of steps the reducer will take before giving up. +const uint32_t kDefaultStepLimit = 250; +} // namespace + +spv_reducer_options_t::spv_reducer_options_t() + : step_limit(kDefaultStepLimit), fail_on_validation_error(false) {} + SPIRV_TOOLS_EXPORT spv_reducer_options spvReducerOptionsCreate() { return new spv_reducer_options_t(); } diff --git a/source/spirv_reducer_options.h b/source/spirv_reducer_options.h index 363517bb..1a431cce 100644 --- a/source/spirv_reducer_options.h +++ b/source/spirv_reducer_options.h @@ -20,14 +20,10 @@ #include #include -// The default maximum number of steps for the reducer to run before giving up. -const uint32_t kDefaultStepLimit = 250; - // Manages command line options passed to the SPIR-V Reducer. New struct // members may be added for any new option. struct spv_reducer_options_t { - spv_reducer_options_t() - : step_limit(kDefaultStepLimit), fail_on_validation_error(false) {} + spv_reducer_options_t(); // See spvReducerOptionsSetStepLimit. uint32_t step_limit;