diff options
Diffstat (limited to 'source/slang/slang.cpp')
| -rw-r--r-- | source/slang/slang.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 7556ac9b2..c78a27f54 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -567,6 +567,9 @@ Type* Program::getTypeFromString(String typeStr, DiagnosticSink* sink) return type; } + + + CompileRequestBase::CompileRequestBase( Linkage* linkage, DiagnosticSink* sink) @@ -1444,6 +1447,22 @@ void DiagnosticSink::noteInternalErrorLoc(SourceLoc const& loc) 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; + + // If there were no errors, and there was no diagnostic output, there is nothing to do. + if(!GetErrorCount() && !outputBuffer.getLength()) return SLANG_OK; + + Slang::ComPtr<ISlangBlob> blob = Slang::StringUtil::createStringBlob(outputBuffer); + *outBlob = blob.detach(); + + return SLANG_OK; +} + + Session* CompileRequestBase::getSession() { return getLinkage()->getSession(); |
