diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-05-19 17:53:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-19 14:53:24 -0700 |
| commit | c4c90f5a6da45229405533372215ba40de91df37 (patch) | |
| tree | b9fdf847656199c5f9b34f081d37ff7f466b7a6d /source/slang/slang.cpp | |
| parent | 61e9154cb797cffe19cfbf3205b4a5a614e8b552 (diff) | |
SourceLoc use in command line processing (#1848)
* #include an absolute path didn't work - because paths were taken to always be relative.
* Added SourceLoc handling for command line parsing.
* Fix typo in debug.
* Fix issue around the DiagnosticSink used in options parsing not having a writer available - by having DiagnosticSink parenting.
* Small rename for clarity.
Co-authored-by: T. Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index ab717536c..c36808199 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -3618,42 +3618,7 @@ TargetProgram::TargetProgram( // -void DiagnosticSink::noteInternalErrorLoc(SourceLoc const& loc) -{ - // Don't consider invalid source locations. - if(!loc.isValid()) - return; - - // If this is the first source location being noted, - // then emit a message to help the user isolate what - // code might have confused the compiler. - if(m_internalErrorLocsNoted == 0) - { - diagnose(loc, Diagnostics::noteLocationOfInternalError); - } - m_internalErrorLocsNoted++; -} - -SlangResult DiagnosticSink::getBlobIfNeeded(ISlangBlob** outBlob) -{ - // If the client doesn't want an output blob, there is nothing to do. - // - if(!outBlob) return SLANG_OK; - // For outputBuffer to be valid and hold diagnostics, writer must not be set - SLANG_ASSERT(writer == nullptr); - - // If there were no errors, and there was no diagnostic output, there is nothing to do. - if(getErrorCount() == 0 && outputBuffer.getLength() == 0) - { - return SLANG_OK; - } - - Slang::ComPtr<ISlangBlob> blob = Slang::StringUtil::createStringBlob(outputBuffer); - *outBlob = blob.detach(); - - return SLANG_OK; -} Session* CompileRequestBase::getSession() |
