From fa664d1419659e3c56db823c60f2b9cc088455cd Mon Sep 17 00:00:00 2001 From: Jay Kwak <82421531+jkwak-work@users.noreply.github.com> Date: Thu, 6 Jun 2024 11:21:23 -0700 Subject: Fix build warnings and treat warnings as error on CI (#4276) * Fix build warnings and treat warnings as error --- source/slang/slang-options.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source/slang/slang-options.cpp') diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index a51ea01fe..7b4b02f68 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -2527,24 +2527,24 @@ SlangResult OptionsParser::_parse( // target that handles that format. Dictionary mapFormatToTargetIndex; - // If there was no explicit `-target` specified, then we will look - // at the `-o` options to see what we can infer. - // - if (m_rawTargets.getCount() == 0) - { - // If there are no targets and no outputs - if (m_rawOutputs.getCount() == 0) - { - m_requestImpl->m_emitIr = true; - } - else + // If there was no explicit `-target` specified, then we will look + // at the `-o` options to see what we can infer. + // + if (m_rawTargets.getCount() == 0) { - for (auto& rawOutput : m_rawOutputs) + // If there are no targets and no outputs + if (m_rawOutputs.getCount() == 0) { - // Some outputs don't imply a target format, and we shouldn't use those for inference. - auto impliedFormat = rawOutput.impliedFormat; - if (impliedFormat == CodeGenTarget::Unknown) - continue; + m_requestImpl->m_emitIr = true; + } + else + { + for (auto& rawOutput : m_rawOutputs) + { + // Some outputs don't imply a target format, and we shouldn't use those for inference. + auto impliedFormat = rawOutput.impliedFormat; + if (impliedFormat == CodeGenTarget::Unknown) + continue; int targetIndex = 0; if (!mapFormatToTargetIndex.tryGetValue(impliedFormat, targetIndex)) -- cgit v1.2.3