mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Enable dead function removal for internal function in whole-module compilation.
This is controlled by a new isWholeModule() attribute in SILModule. It gives about 9% code size reduction on the benchmark executables. For test-suite reasons it is currently not done for the stdlib. Swift SVN r22491
This commit is contained in:
@@ -180,7 +180,14 @@ static bool performCompile(CompilerInstance &Instance,
|
||||
if (PrimarySourceFile)
|
||||
SM = performSILGeneration(*PrimarySourceFile, None, opts.SILSerializeAll);
|
||||
else
|
||||
SM = performSILGeneration(Instance.getMainModule(), opts.SILSerializeAll);
|
||||
SM = performSILGeneration(Instance.getMainModule(), opts.SILSerializeAll,
|
||||
// Only do whole-module compilation if these options are not set.
|
||||
// This is to keep the test suite happy (many tests use internal
|
||||
// functions).
|
||||
// TODO: add a separate option to explicitly disable whole-
|
||||
// module compilation (to be used in the testsuite).
|
||||
Invocation.getLangOptions().EnableAccessControl &&
|
||||
Invocation.getLangOptions().EnableObjCAttrRequiresFoundation);
|
||||
}
|
||||
|
||||
// We've been told to emit SIL after SILGen, so write it now.
|
||||
|
||||
Reference in New Issue
Block a user