summaryrefslogtreecommitdiff
path: root/source/slang/diagnostics.h
diff options
context:
space:
mode:
authorTim Foley <tim.foley.is@gmail.com>2017-07-19 18:52:38 -0700
committerGitHub <noreply@github.com>2017-07-19 18:52:38 -0700
commitf07c01ceb012b9b325a8ecebd12cdd5797d8d5b3 (patch)
tree0b93a109d51e6565560ad785519a863386490e2a /source/slang/diagnostics.h
parenta2b8b4c20632d79721052abd232fe2d1bdf2700d (diff)
parent3f48e1c0d84bf4909954154ad147559656e87516 (diff)
Merge pull request #128 from tfoleyNV/improve-failure-modes
Try to improve handling of failures during compilation
Diffstat (limited to 'source/slang/diagnostics.h')
-rw-r--r--source/slang/diagnostics.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/diagnostics.h b/source/slang/diagnostics.h
index 988cb742b..f88bf460e 100644
--- a/source/slang/diagnostics.h
+++ b/source/slang/diagnostics.h
@@ -206,15 +206,15 @@ namespace Slang
#define SLANG_UNIMPLEMENTED(sink, pos, what) \
(sink)->diagnose(Slang::CodePosition(__LINE__, 0, 0, __FILE__), Slang::Diagnostics::unimplemented, what)
-#define SLANG_UNREACHABLE(msg) do { assert(!"ureachable code:" msg); throw 0; } while(0)
#else
#define SLANG_INTERNAL_ERROR(sink, pos) \
(sink)->diagnose(pos, Slang::Diagnostics::internalCompilerError)
#define SLANG_UNIMPLEMENTED(sink, pos, what) \
(sink)->diagnose(pos, Slang::Diagnostics::unimplemented, what)
-// TODO: find something that will perform better
-#define SLANG_UNREACHABLE(msg) exit(1)
#endif
+#define SLANG_DIAGNOSE_UNEXPECTED(sink, pos, message) \
+ (sink)->diagnose(pos, Slang::Diagnostics::unexpected, message)
+
#endif