diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /source/core/slang-exception.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'source/core/slang-exception.h')
| -rw-r--r-- | source/core/slang-exception.h | 96 |
1 files changed, 45 insertions, 51 deletions
diff --git a/source/core/slang-exception.h b/source/core/slang-exception.h index 3c5621d7f..654ce0156 100644 --- a/source/core/slang-exception.h +++ b/source/core/slang-exception.h @@ -6,61 +6,55 @@ 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: - String Message; - Exception() - {} - Exception(const String & message) - : Message(message) - { - } +// 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. - virtual ~Exception() - {} - }; +class Exception +{ +public: + String Message; + Exception() {} + Exception(const String& message) + : Message(message) + { + } - class InvalidOperationException : public Exception - { - public: - InvalidOperationException() - {} - InvalidOperationException(const String & message) - : Exception(message) - { - } + virtual ~Exception() {} +}; + +class InvalidOperationException : public Exception +{ +public: + InvalidOperationException() {} + InvalidOperationException(const String& message) + : Exception(message) + { + } +}; - }; - - class InternalError : public Exception - { - public: - InternalError() - {} - InternalError(const String & message) - : Exception(message) - { - } - }; +class InternalError : public Exception +{ +public: + InternalError() {} + InternalError(const String& message) + : Exception(message) + { + } +}; - class AbortCompilationException : public Exception +class AbortCompilationException : public Exception +{ +public: + AbortCompilationException() {} + AbortCompilationException(const String& message) + : Exception(message) { - public: - AbortCompilationException() - {} - AbortCompilationException(const String & message) - : Exception(message) - { - } - }; -} + } +}; +} // namespace Slang #endif |
