Register deserialization notification handlers in ome only once

This commit is contained in:
Meghana Gupta
2020-07-29 14:38:12 -07:00
parent 9c9a8ef224
commit a415d87a28
3 changed files with 35 additions and 4 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);