From 7f266f1ea7a51213069282296a905650fd405c3f Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 4 Feb 2021 14:23:32 -0500 Subject: DownstreamDiagnostic::Type -> Severity (#1687) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP diagnostics for line number output. * Small param naming change * Use x macro for pass through compile human name lookup/getting. * WIP on parsing downstream compiler output. * Split out parsing into ParseDiagnosticUtil. Added test result of single line. * Dump out the std output on fail to parse diagnostics. * Change test type for syntax-error-intrinsic.slang be TEST not TEST_DIAGNOSTIC * Use Index for StringUtil. * WIP: First pass support for parsing Slang diagnostics. * WIP Testing comparing with ParseDiagnosticUtil with previous ad-hoc mechanism. * Use the new parsing mechanism for diagnostic comparisons. * Improvements to diagnostics parsing. Better error handling, and fallback handling. Added ability to parse downstream compilers without a prefix. Added ability to parse Slang with a prefix. * DownstreamDiagnostic::Type -> Severity and related fixes. * Small fixes around moving from DownstreamDiagnostic::Type -> Severity * Small comment fixes. Co-authored-by: Tim Foley --- source/slang/slang-compiler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/slang') diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp index 1e9357f4f..993a4966e 100755 --- a/source/slang/slang-compiler.cpp +++ b/source/slang/slang-compiler.cpp @@ -1541,22 +1541,22 @@ SlangResult dissassembleDXILUsingDXC( // Severity severity = Severity::Error; - switch (diagnostic.type) + switch (diagnostic.severity) { - case Diagnostic::Type::Unknown: - case Diagnostic::Type::Error: + case Diagnostic::Severity::Unknown: + case Diagnostic::Severity::Error: { severity = Severity::Error; builder << "error"; break; } - case Diagnostic::Type::Warning: + case Diagnostic::Severity::Warning: { severity = Severity::Warning; builder << "warning"; break; } - case Diagnostic::Type::Info: + case Diagnostic::Severity::Info: { severity = Severity::Note; builder << "info"; @@ -1572,7 +1572,7 @@ SlangResult dissassembleDXILUsingDXC( } // If any errors are emitted, then we are done - if (diagnostics.has(DownstreamDiagnostic::Type::Error)) + if (diagnostics.has(DownstreamDiagnostic::Severity::Error)) { return SLANG_FAIL; } -- cgit v1.2.3