Add a HasAccessMarkers flag to SILFunction.

This allows the verifier to be run before and after marker elimination.
This commit is contained in:
Andrew Trick
2017-04-08 18:14:47 -07:00
parent 41b388d954
commit 44110e361d
3 changed files with 25 additions and 0 deletions

View File

@@ -208,6 +208,10 @@ private:
/// after the pass runs, we only see a semantic-arc world.
bool HasQualifiedOwnership = true;
/// True if all memory access in this function is demarcated by well-formed
/// memory access markers.
bool HasAccessMarkers = false;
SILFunction(SILModule &module, SILLinkage linkage, StringRef mangledName,
CanSILFunctionType loweredType, GenericEnvironment *genericEnv,
Optional<SILLocation> loc, IsBare_t isBareSILFunction,
@@ -320,6 +324,15 @@ public:
HasQualifiedOwnership = false;
}
/// Returns true if this function has well-formed access markers describing
/// all memory access.
bool hasAccessMarkers() const { return HasAccessMarkers; }
/// Sets the HasAccessMarkers flag to false.
void disableAccessMarkers() {
HasAccessMarkers = false;
}
/// Returns the calling convention used by this entry point.
SILFunctionTypeRepresentation getRepresentation() const {
return getLoweredFunctionType()->getRepresentation();