mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: store IRGenOptions in SILModule
SIL optimization passes can use the IRGen options to do target specific optimizations.
This commit is contained in:
@@ -2243,7 +2243,7 @@ ASTLoweringRequest::evaluate(Evaluator &evaluator,
|
||||
SILInstruction::resetInstructionCounts();
|
||||
|
||||
auto silMod = SILModule::createEmptyModule(desc.context, desc.conv,
|
||||
desc.opts);
|
||||
desc.opts, desc.irgenOptions);
|
||||
|
||||
// If all function bodies are being skipped there's no reason to do any
|
||||
// SIL generation.
|
||||
@@ -2285,15 +2285,18 @@ ASTLoweringRequest::evaluate(Evaluator &evaluator,
|
||||
|
||||
std::unique_ptr<SILModule>
|
||||
swift::performASTLowering(ModuleDecl *mod, Lowering::TypeConverter &tc,
|
||||
const SILOptions &options) {
|
||||
auto desc = ASTLoweringDescriptor::forWholeModule(mod, tc, options);
|
||||
const SILOptions &options,
|
||||
const IRGenOptions *irgenOptions) {
|
||||
auto desc = ASTLoweringDescriptor::forWholeModule(mod, tc, options,
|
||||
None, irgenOptions);
|
||||
return llvm::cantFail(
|
||||
mod->getASTContext().evaluator(ASTLoweringRequest{desc}));
|
||||
}
|
||||
|
||||
std::unique_ptr<SILModule>
|
||||
swift::performASTLowering(FileUnit &sf, Lowering::TypeConverter &tc,
|
||||
const SILOptions &options) {
|
||||
auto desc = ASTLoweringDescriptor::forFile(sf, tc, options);
|
||||
const SILOptions &options,
|
||||
const IRGenOptions *irgenOptions) {
|
||||
auto desc = ASTLoweringDescriptor::forFile(sf, tc, options, None, irgenOptions);
|
||||
return llvm::cantFail(sf.getASTContext().evaluator(ASTLoweringRequest{desc}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user