[semantic-sil] Add a semantic attribute "verify.ownership.sil.never".

This semantic attribute allows a user to disable ownership verification on
specific functions.

The intention is that once I turn on the sil ownership verifier for parts of the
stdlib, if an engineer exposes an ownership issue, they can disable ownership
verification on that specific function, file a bug, and continue with their
work.

rdar://31880847
This commit is contained in:
Michael Gottesman
2017-07-10 13:12:18 -07:00
parent d84e4b4de1
commit 1264cfa492
4 changed files with 48 additions and 6 deletions

View File

@@ -464,3 +464,7 @@ SubstitutionList SILFunction::getForwardingSubstitutions() {
ForwardingSubs = env->getForwardingSubstitutions();
return *ForwardingSubs;
}
bool SILFunction::shouldVerifyOwnership() const {
return !hasSemanticsAttr("verify.ownership.sil.never");
}