diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-10-04 14:15:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-04 14:15:51 -0400 |
| commit | 97bb82ebcdf8f1391b9d93b5a8d7b1dfc4e88e52 (patch) | |
| tree | f120ba282cbea96d23ed179737984a4610d3b520 /source/core/slang-exception.h | |
| parent | b3dfe383c6d31ff3dbd76dcfb32de8d536382f3e (diff) | |
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.
Diffstat (limited to 'source/core/slang-exception.h')
| -rw-r--r-- | source/core/slang-exception.h | 87 |
1 files changed, 8 insertions, 79 deletions
diff --git a/source/core/slang-exception.h b/source/core/slang-exception.h index 91139e298..3c5621d7f 100644 --- a/source/core/slang-exception.h +++ b/source/core/slang-exception.h @@ -6,6 +6,13 @@ namespace Slang { + // NOTE! + // Exceptions should not generally be used in core/compiler-core, use the 'signal' mechanism + // ideally using the macros in the slang-signal.h such as `SLANG_UNEXPECTED` + // + // If core/compiler-core libraries are compiled with SLANG_DISABLE_EXCEPTIONS, + // these classes will *never* be thrown. + class Exception { public: @@ -21,18 +28,6 @@ namespace Slang {} }; - class IndexOutofRangeException : public Exception - { - public: - IndexOutofRangeException() - {} - IndexOutofRangeException(const String & message) - : Exception(message) - { - } - - }; - class InvalidOperationException : public Exception { public: @@ -44,73 +39,7 @@ namespace Slang } }; - - class ArgumentException : public Exception - { - public: - ArgumentException() - {} - ArgumentException(const String & message) - : Exception(message) - { - } - - }; - - class KeyNotFoundException : public Exception - { - public: - KeyNotFoundException() - {} - KeyNotFoundException(const String & message) - : Exception(message) - { - } - }; - class KeyExistsException : public Exception - { - public: - KeyExistsException() - {} - KeyExistsException(const String & message) - : Exception(message) - { - } - }; - - class NotSupportedException : public Exception - { - public: - NotSupportedException() - {} - NotSupportedException(const String & message) - : Exception(message) - { - } - }; - - class NotImplementedException : public Exception - { - public: - NotImplementedException() - {} - NotImplementedException(const String & message) - : Exception(message) - { - } - }; - - class InvalidProgramException : public Exception - { - public: - InvalidProgramException() - {} - InvalidProgramException(const String & message) - : Exception(message) - { - } - }; - + class InternalError : public Exception { public: |
