mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Propagate "-O" to Clang (as "-Os").
It affects Clang IRGen, among other things.
This commit is contained in:
@@ -1352,7 +1352,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
IRGenOptions &IRGenOpts,
|
||||
FrontendOptions &FEOpts,
|
||||
DiagnosticEngine &Diags,
|
||||
const llvm::Triple &Triple) {
|
||||
const llvm::Triple &Triple,
|
||||
ClangImporterOptions &ClangOpts) {
|
||||
using namespace options;
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_sil_inline_threshold)) {
|
||||
@@ -1408,6 +1409,10 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
IRGenOpts.Optimize = true;
|
||||
Opts.Optimization = SILOptions::SILOptMode::Optimize;
|
||||
}
|
||||
|
||||
if (IRGenOpts.Optimize) {
|
||||
ClangOpts.Optimization = "-Os";
|
||||
}
|
||||
}
|
||||
|
||||
if (Args.getLastArg(OPT_AssumeSingleThreaded)) {
|
||||
@@ -1799,7 +1804,7 @@ bool CompilerInvocation::parseArgs(ArrayRef<const char *> Args,
|
||||
}
|
||||
|
||||
if (ParseSILArgs(SILOpts, ParsedArgs, IRGenOpts, FrontendOpts, Diags,
|
||||
LangOpts.Target)) {
|
||||
LangOpts.Target, ClangImporterOpts)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user