@@ -103,6 +103,7 @@ class AnyFunctionType;
103103class ASTContext ;
104104class FileUnit ;
105105class FuncDecl ;
106+ class IRGenOptions ;
106107class KeyPathPattern ;
107108class ModuleDecl ;
108109class SILUndef ;
@@ -353,6 +354,12 @@ class SILModule {
353354 // / The options passed into this SILModule.
354355 const SILOptions &Options;
355356
357+ // / IRGen options to be used by target specific SIL optimization passes.
358+ // /
359+ // / Not null, if the module is created by the compiler itself (and not
360+ // / e.g. by lldb).
361+ const IRGenOptions *irgenOptions;
362+
356363 // / The number of functions created in this module, which will be the index of
357364 // / the next function.
358365 unsigned nextFunctionIndex = 0 ;
@@ -382,7 +389,8 @@ class SILModule {
382389#endif
383390
384391 SILModule (llvm::PointerUnion<FileUnit *, ModuleDecl *> context,
385- Lowering::TypeConverter &TC, const SILOptions &Options);
392+ Lowering::TypeConverter &TC, const SILOptions &Options,
393+ const IRGenOptions *irgenOptions = nullptr );
386394
387395 SILModule (const SILModule&) = delete ;
388396 void operator =(const SILModule&) = delete ;
@@ -537,7 +545,8 @@ class SILModule {
537545 // / single-file mode, and a ModuleDecl in whole-module mode.
538546 static std::unique_ptr<SILModule>
539547 createEmptyModule (llvm::PointerUnion<FileUnit *, ModuleDecl *> context,
540- Lowering::TypeConverter &TC, const SILOptions &Options);
548+ Lowering::TypeConverter &TC, const SILOptions &Options,
549+ const IRGenOptions *irgenOptions = nullptr );
541550
542551 // / Get the Swift module associated with this SIL module.
543552 ModuleDecl *getSwiftModule () const { return TheSwiftModule; }
@@ -570,6 +579,7 @@ class SILModule {
570579 bool isOptimizedOnoneSupportModule () const ;
571580
572581 const SILOptions &getOptions () const { return Options; }
582+ const IRGenOptions *getIRGenOptionsOrNull () const { return irgenOptions; }
573583
574584 using iterator = FunctionListType::iterator;
575585 using const_iterator = FunctionListType::const_iterator;
0 commit comments