From c4c90f5a6da45229405533372215ba40de91df37 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 May 2021 17:53:24 -0400 Subject: 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 --- source/slang/slang.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'source/slang/slang.cpp') 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 blob = Slang::StringUtil::createStringBlob(outputBuffer); - *outBlob = blob.detach(); - - return SLANG_OK; -} Session* CompileRequestBase::getSession() -- cgit v1.2.3