Add -g0 command line argument

Analogous to gcc, -g0 would strip all debug info.  This is done
regardless of whether optimizations are enabled.

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
This commit is contained in:
Shahbaz Youssefi 2020-06-17 12:47:44 -04:00
parent 051c6fed88
commit d52dce5067
No known key found for this signature in database
GPG key ID: C6149357EC6727E0
4 changed files with 87 additions and 43 deletions

View file

@ -8738,10 +8738,14 @@ void GlslangToSpv(const TIntermediate& intermediate, std::vector<unsigned int>&
// If from HLSL, run spirv-opt to "legalize" the SPIR-V for Vulkan
// eg. forward and remove memory writes of opaque types.
bool prelegalization = intermediate.getSource() == EShSourceHlsl;
if ((intermediate.getSource() == EShSourceHlsl || options->optimizeSize) && !options->disableOptimizer) {
SpirvToolsLegalize(intermediate, spirv, logger, options);
if ((prelegalization || options->optimizeSize) && !options->disableOptimizer) {
SpirvToolsTransform(intermediate, spirv, logger, options);
prelegalization = false;
}
else if (options->stripDebugInfo) {
// Strip debug info even if optimization is disabled.
SpirvToolsStripDebugInfo(intermediate, spirv, logger);
}
if (options->validate)
SpirvToolsValidate(intermediate, spirv, logger, prelegalization);