summaryrefslogtreecommitdiff
path: root/source/slang/slang-options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-options.cpp')
-rw-r--r--source/slang/slang-options.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 76ebcca52..7429db2fc 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -497,7 +497,7 @@ struct OptionsParser
else if (argStr == "-dump-repro")
{
SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, requestImpl->dumpRepro));
- spEnableReproCapture(asExternal(requestImpl));
+ spEnableReproCapture(compileRequest);
}
else if (argStr == "-dump-repro-on-error")
{
@@ -510,6 +510,13 @@ struct OptionsParser
SLANG_RETURN_ON_FAIL(StateSerializeUtil::extractFilesToDirectory(reproName));
}
+ else if (argStr == "-module-name")
+ {
+ String moduleName;
+ SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, moduleName));
+
+ spSetDefaultModuleName(compileRequest, moduleName.getBuffer());
+ }
else if(argStr == "-load-repro")
{
String reproName;
@@ -860,16 +867,16 @@ struct OptionsParser
}
else if (argStr == "-r")
{
- String moduleName;
- SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, moduleName));
+ String referenceModuleName;
+ SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, referenceModuleName));
// We need to deserialize and add the modules
- FileStream fileStream(moduleName, FileMode::Open, FileAccess::Read, FileShare::ReadWrite);
+ FileStream fileStream(referenceModuleName, FileMode::Open, FileAccess::Read, FileShare::ReadWrite);
List<RefPtr<IRModule>> irModules;
if (SLANG_FAILED(IRSerialReader::readStreamModules(&fileStream, asInternal(session), requestImpl->getFrontEndReq()->getSourceManager(), irModules)))
{
- sink->diagnose(SourceLoc(), Diagnostics::unableToReadModuleContainer, moduleName);
+ sink->diagnose(SourceLoc(), Diagnostics::unableToReadModuleContainer, referenceModuleName);
return SLANG_FAIL;
}