@@ -307,6 +307,12 @@ class SILModule {
307307 // / The stage of processing this module is at.
308308 SILStage Stage;
309309
310+ // / True if SIL conventions force address-only to be passed by address.
311+ // /
312+ // / Used for bootstrapping the AddressLowering pass. This should eventually
313+ // / be inferred from the SIL stage to be true only when Stage == Lowered.
314+ bool loweredAddresses;
315+
310316 // / The set of deserialization notification handlers.
311317 DeserializationNotificationHandlerSet deserializationNotificationHandlers;
312318
@@ -806,6 +812,11 @@ class SILModule {
806812 Stage = s;
807813 }
808814
815+ // / True if SIL conventions force address-only to be passed by address.
816+ bool useLoweredAddresses () const { return loweredAddresses; }
817+
818+ void setLoweredAddresses (bool val) { loweredAddresses = val; }
819+
809820 llvm::IndexedInstrProfReader *getPGOReader () const { return PGOReader.get (); }
810821
811822 void setPGOReader (std::unique_ptr<llvm::IndexedInstrProfReader> IPR) {
@@ -972,15 +983,13 @@ inline bool SILOptions::supportsLexicalLifetimes(const SILModule &mod) const {
972983 // entirely.
973984 return LexicalLifetimes != LexicalLifetimesOption::Off;
974985 case SILStage::Canonical:
986+ case SILStage::Lowered:
975987 // In Canonical SIL, lexical markers are used to ensure that object
976988 // lifetimes do not get observably shortened from the end of a lexical
977989 // scope. That behavior only occurs when lexical lifetimes is (fully)
978990 // enabled. (When only diagnostic markers are enabled, the markers are
979991 // stripped as part of lowering from raw to canonical SIL.)
980992 return LexicalLifetimes == LexicalLifetimesOption::On;
981- case SILStage::Lowered:
982- // We do not support OSSA in Lowered SIL, so this is always false.
983- return false ;
984993 }
985994}
986995
0 commit comments