mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add a new semantics attribute to disable SIL verification on a function
This provides a way to disable verification per function instead of the entire module.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "swift/AST/Decl.h"
|
||||
#include "swift/AST/GenericEnvironment.h"
|
||||
#include "swift/AST/Module.h"
|
||||
#include "swift/AST/SemanticAttrs.h"
|
||||
#include "swift/AST/Types.h"
|
||||
#include "swift/Basic/Assertions.h"
|
||||
#include "swift/Basic/Range.h"
|
||||
@@ -866,6 +867,14 @@ void SILInstruction::verifyOperandOwnership(
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (getModule().getOptions().VerifyNone) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getFunction()->hasSemanticsAttr(semantics::NO_SIL_VERIFICATION)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If SILOwnership is not enabled, do not perform verification.
|
||||
if (!getModule().getOptions().VerifySILOwnership)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user