Add a new -assume-single-threaded option

This is a hidden option. It should be used like: -assume-single-threaded

When this function is provided, the compiler assumes that the code will be executed in the single threaded mode. It then performs certain optimizations that can benefit from it, e.g. it  marks as non-atomic all reference counting instructions in the user code being compiled.
This commit is contained in:
Roman Levenstein
2016-12-02 15:58:38 -08:00
parent 6f9dd9a704
commit 354fd29f31
8 changed files with 131 additions and 0 deletions

View File

@@ -1114,6 +1114,10 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
}
}
if (Args.getLastArg(OPT_AssumeSingleThreaded)) {
Opts.AssumeSingleThreaded = true;
}
// Parse the assert configuration identifier.
if (const Arg *A = Args.getLastArg(OPT_AssertConfig)) {
StringRef Configuration = A->getValue();