Pass in SILOptions to SILModule.

This should have been done a long time ago since SILOptions are options that
should be able to effect everything SIL related. In this case I just want to
pass in a flag on the SILModule to enable +0 self. By putting it on the
SILModule I can conveniently check it in SILFunctionType without exposing any
internal state from SILFunctionType.cpp.

Swift SVN r23647
This commit is contained in:
Michael Gottesman
2014-12-03 07:43:52 +00:00
parent 17e85e60e4
commit 85e2502f96
10 changed files with 49 additions and 25 deletions

View File

@@ -329,9 +329,11 @@ static bool performCompile(CompilerInstance &Instance,
std::unique_ptr<SILModule> SM = Instance.takeSILModule();
if (!SM) {
if (PrimarySourceFile)
SM = performSILGeneration(*PrimarySourceFile, None, opts.SILSerializeAll);
SM = performSILGeneration(*PrimarySourceFile, Invocation.getSILOptions(),
None, opts.SILSerializeAll);
else
SM = performSILGeneration(Instance.getMainModule(), opts.SILSerializeAll,
SM = performSILGeneration(Instance.getMainModule(), Invocation.getSILOptions(),
opts.SILSerializeAll,
true);
}