diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-01-16 13:31:42 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-16 13:31:42 -0500 |
| commit | 86e11e0e111fab60b9517056ac049bfac6e3bd25 (patch) | |
| tree | f34a8343fb6a949235f1973dc873814f408987ef /source/slang/diagnostics.cpp | |
| parent | c260e6aa3a7dc3e6794442daacde3ae23f029e0b (diff) | |
Feature/external compiler reporting (#776)
* Added support for converting SlangResult to string in PlatformUtil.
* * Added reportExternalCompilerError
* Made external compilers use this
* Made DiagnosticSink accept UnownedStringSlice
* Made emitXXX compiler functions return SlangError
* Use smart pointers to handle life of Com interfaces
* * Make SlangResult compatible with HRESULT for some common cases.
* Make PlatformUtil::appendResult return SlangResult
* Compile check SLANG_RESULT.
* Add tests for checking diagnostics from external compilers.
* * Make external compiler tests only run on windows for now.
* Added 'windows' and 'unix' categories
* Added categories based on what backends are available. Will make more tests run on linux and handle case where dxcompiler is not available on appveyor.
* * Added spSessionCheckPassThroughSupport
* Use to determine whats available for categories for tests
* Add support for outputting source filename/s when using pass through.
Diffstat (limited to 'source/slang/diagnostics.cpp')
| -rw-r--r-- | source/slang/diagnostics.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/slang/diagnostics.cpp b/source/slang/diagnostics.cpp index 4000fd967..4cad7ce94 100644 --- a/source/slang/diagnostics.cpp +++ b/source/slang/diagnostics.cpp @@ -263,6 +263,13 @@ void DiagnosticSink::diagnoseRaw( Severity severity, char const* message) { + return diagnoseRaw(severity, UnownedStringSlice(message)); +} + +void DiagnosticSink::diagnoseRaw( + Severity severity, + const UnownedStringSlice& message) +{ if (severity >= Severity::Error) { errorCount++; @@ -272,7 +279,7 @@ void DiagnosticSink::diagnoseRaw( if(writer) { // If so, pass the error string along to them - writer->write(message, ::strlen(message)); + writer->write(message.begin(), message.size()); } else { |
