Revert "Revert #33106 and #33205" (#34106)

This commit is contained in:
Meghana Gupta
2020-09-28 23:08:14 -07:00
committed by GitHub
parent c5aaf1fa8b
commit 163d47ec90
11 changed files with 104 additions and 71 deletions

View File

@@ -263,6 +263,15 @@ private:
/// to ensure that the module is serialized only once.
bool serialized;
/// Set if we have registered a deserialization notification handler for
/// lowering ownership in non transparent functions.
/// This gets set in NonTransparent OwnershipModelEliminator pass.
bool regDeserializationNotificationHandlerForNonTransparentFuncOME;
/// Set if we have registered a deserialization notification handler for
/// lowering ownership in transparent functions.
/// This gets set in OwnershipModelEliminator pass.
bool regDeserializationNotificationHandlerForAllFuncOME;
/// Action to be executed for serializing the SILModule.
ActionCallback SerializeSILAction;
@@ -301,6 +310,19 @@ public:
deserializationNotificationHandlers.erase(handler);
}
bool hasRegisteredDeserializationNotificationHandlerForNonTransparentFuncOME() {
return regDeserializationNotificationHandlerForNonTransparentFuncOME;
}
bool hasRegisteredDeserializationNotificationHandlerForAllFuncOME() {
return regDeserializationNotificationHandlerForAllFuncOME;
}
void setRegisteredDeserializationNotificationHandlerForNonTransparentFuncOME() {
regDeserializationNotificationHandlerForNonTransparentFuncOME = true;
}
void setRegisteredDeserializationNotificationHandlerForAllFuncOME() {
regDeserializationNotificationHandlerForAllFuncOME = true;
}
/// Add a delete notification handler \p Handler to the module context.
void registerDeleteNotificationHandler(DeleteNotificationHandler* Handler);