From 97bb82ebcdf8f1391b9d93b5a8d7b1dfc4e88e52 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Mon, 4 Oct 2021 14:15:51 -0400 Subject: Removing exceptions from core/compiler-core (#1953) * #include an absolute path didn't work - because paths were taken to always be relative. * Refactor Stream. Working on all tests. * Split out CharEncode. * Make method names lower camel. m_prefix in Writer/Reader * Tidy up around CharEncode interface. * Small improvements around encode/decode. * Better use of types. * Remove readLine from TextReader. * Remove exceptions from Stream/Text handling. * Fix some typos. * Fix tabbing. * Fix missing override. * Remove remaining exception throw/catch via using signal mechanism. * Remove exceptions that are not used anymore. * Document the Stream interface. * Remove index for decoding 'get byte' function. * Fix CharReader -> ByteReader. --- source/compiler-core/slang-diagnostic-sink.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/compiler-core/slang-diagnostic-sink.cpp') diff --git a/source/compiler-core/slang-diagnostic-sink.cpp b/source/compiler-core/slang-diagnostic-sink.cpp index a6502abc9..c92610e85 100644 --- a/source/compiler-core/slang-diagnostic-sink.cpp +++ b/source/compiler-core/slang-diagnostic-sink.cpp @@ -112,7 +112,7 @@ static void formatDiagnosticMessage(StringBuilder& sb, char const* format, int a if (index >= argCount) { // TODO(tfoley): figure out what a good policy will be for "panic" situations like this - throw InvalidOperationException("too few arguments for diagnostic message"); + SLANG_INVALID_OPERATION("too few arguments for diagnostic message"); } else { @@ -123,7 +123,7 @@ static void formatDiagnosticMessage(StringBuilder& sb, char const* format, int a break; default: - throw InvalidOperationException("invalid diagnostic message format"); + SLANG_INVALID_OPERATION("invalid diagnostic message format"); break; } @@ -512,7 +512,7 @@ void DiagnosticSink::diagnoseImpl(DiagnosticInfo const& info, const UnownedStrin if (info.severity >= Severity::Fatal) { // TODO: figure out a better policy for aborting compilation - throw AbortCompilationException(); + SLANG_ABORT_COMPILATION(""); } } @@ -573,7 +573,7 @@ void DiagnosticSink::diagnoseRaw( if (severity >= Severity::Fatal) { // TODO: figure out a better policy for aborting compilation - throw InvalidOperationException(); + SLANG_ABORT_COMPILATION(""); } } -- cgit v1.2.3