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/core/slang-nvrtc-compiler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/core/slang-nvrtc-compiler.cpp') diff --git a/source/core/slang-nvrtc-compiler.cpp b/source/core/slang-nvrtc-compiler.cpp index 78afc618f..eb117379f 100644 --- a/source/core/slang-nvrtc-compiler.cpp +++ b/source/core/slang-nvrtc-compiler.cpp @@ -190,7 +190,7 @@ static bool _hasDriveLetter(const UnownedStringSlice& line) static SlangResult _parseNVRTCLine(const UnownedStringSlice& line, DownstreamDiagnostic& outDiagnostic) { typedef DownstreamDiagnostic Diagnostic; - typedef Diagnostic::Type Type; + typedef Diagnostic::Severity Severity; outDiagnostic.stage = Diagnostic::Stage::Compile; @@ -215,11 +215,11 @@ static SlangResult _parseNVRTCLine(const UnownedStringSlice& line, DownstreamDia if (split1 == "error") { - outDiagnostic.type = Type::Error; + outDiagnostic.severity = Severity::Error; } else if (split1 == "warning") { - outDiagnostic.type = Type::Warning; + outDiagnostic.severity = Severity::Warning; } outDiagnostic.text = split[2].trim(); @@ -461,7 +461,7 @@ SlangResult NVRTCDownstreamCompiler::compile(const CompileOptions& options, RefP } // if it has a compilation error.. set on output - if (diagnostics.has(DownstreamDiagnostic::Type::Error)) + if (diagnostics.has(DownstreamDiagnostic::Severity::Error)) { diagnostics.result = SLANG_FAIL; } -- cgit v1.2.3