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.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index 1523170cf..c7ede8d93 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -512,6 +512,8 @@ struct OptionsParser
SlangMatrixLayoutMode defaultMatrixLayoutMode = SLANG_MATRIX_LAYOUT_MODE_UNKNOWN;
+ bool hasLoadedRepro = false;
+
char const* const* argCursor = &argv[0];
char const* const* argEnd = &argv[argc];
while (argCursor != argEnd)
@@ -533,6 +535,12 @@ struct OptionsParser
{
spSetDumpIntermediates(compileRequest, true);
}
+ else if (argStr == "-dump-intermediate-prefix")
+ {
+ String prefix;
+ SLANG_RETURN_ON_FAIL(tryReadCommandLineArgument(sink, arg, &argCursor, argEnd, prefix));
+ requestImpl->getBackEndReq()->m_dumpIntermediatePrefix = prefix;
+ }
else if(argStr == "-dump-ir" )
{
requestImpl->getFrontEndReq()->shouldDumpIR = true;
@@ -587,13 +595,7 @@ struct OptionsParser
SLANG_RETURN_ON_FAIL(StateSerializeUtil::load(base, requestState, fileSystem, requestImpl));
- if (argCursor < argEnd)
- {
- sink->diagnose(SourceLoc(), Diagnostics::parametersAfterLoadReproIgnored);
- return SLANG_FAIL;
- }
-
- return SLANG_OK;
+ hasLoadedRepro = true;
}
else if (argStr == "-repro-file-system")
{
@@ -1055,6 +1057,15 @@ struct OptionsParser
}
}
+ // TODO(JS): This is a restriction because of how setting of state works for load repro
+ // If a repro has been loaded, then many of the following options will overwrite
+ // what was set up. So for now they are ignored, and only parameters set as part
+ // of the loop work if they are after -load-repro
+ if (hasLoadedRepro)
+ {
+ return SLANG_OK;
+ }
+
spSetCompileFlags(compileRequest, flags);
// As a compatability feature, if the user didn't list any explicit entry