SILModule::hasLoweredAddress

This commit is contained in:
Andrew Trick
2022-02-14 23:23:42 -08:00
parent 8457ba30ed
commit 2907c61203
9 changed files with 39 additions and 25 deletions

View File

@@ -307,6 +307,12 @@ private:
/// The stage of processing this module is at.
SILStage Stage;
/// True if SIL conventions force address-only to be passed by address.
///
/// Used for bootstrapping the AddressLowering pass. This should eventually
/// be inferred from the SIL stage to be true only when Stage == Lowered.
bool loweredAddresses;
/// The set of deserialization notification handlers.
DeserializationNotificationHandlerSet deserializationNotificationHandlers;
@@ -796,6 +802,11 @@ public:
Stage = s;
}
/// True if SIL conventions force address-only to be passed by address.
bool useLoweredAddresses() const { return loweredAddresses; }
void setLoweredAddresses(bool val) { loweredAddresses = val; }
llvm::IndexedInstrProfReader *getPGOReader() const { return PGOReader.get(); }
void setPGOReader(std::unique_ptr<llvm::IndexedInstrProfReader> IPR) {
@@ -962,15 +973,13 @@ inline bool SILOptions::supportsLexicalLifetimes(const SILModule &mod) const {
// entirely.
return LexicalLifetimes != LexicalLifetimesOption::Off;
case SILStage::Canonical:
case SILStage::Lowered:
// In Canonical SIL, lexical markers are used to ensure that object
// lifetimes do not get observably shortened from the end of a lexical
// scope. That behavior only occurs when lexical lifetimes is (fully)
// enabled. (When only diagnostic markers are enabled, the markers are
// stripped as part of lowering from raw to canonical SIL.)
return LexicalLifetimes == LexicalLifetimesOption::On;
case SILStage::Lowered:
// We do not support OSSA in Lowered SIL, so this is always false.
return false;
}
}