Skip to content

Commit d3c3bca

Browse files
committed
Revert "Add a new semantics attribute to disable SIL verification on a function"
This reverts commit aa01b2a.
1 parent 4479e49 commit d3c3bca

File tree

5 files changed

+5
-35
lines changed

5 files changed

+5
-35
lines changed

include/swift/AST/SemanticAttrs.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,5 @@ SEMANTICS_ATTR(USE_FRAME_POINTER, "use_frame_pointer")
165165
SEMANTICS_ATTR(FIXED_STORAGE_CHECK_INDEX, "fixed_storage.check_index")
166166
SEMANTICS_ATTR(FIXED_STORAGE_GET_COUNT, "fixed_storage.get_count")
167167

168-
SEMANTICS_ATTR(NO_SIL_VERIFICATION, "sil.verify_none")
169-
170168
#undef SEMANTICS_ATTR
171169

lib/SIL/Verifier/SILOwnershipVerifier.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "swift/AST/Decl.h"
2121
#include "swift/AST/GenericEnvironment.h"
2222
#include "swift/AST/Module.h"
23-
#include "swift/AST/SemanticAttrs.h"
2423
#include "swift/AST/Types.h"
2524
#include "swift/Basic/Assertions.h"
2625
#include "swift/Basic/Range.h"
@@ -867,14 +866,6 @@ void SILInstruction::verifyOperandOwnership(
867866
return;
868867
#endif
869868

870-
if (getModule().getOptions().VerifyNone) {
871-
return;
872-
}
873-
874-
if (getFunction()->hasSemanticsAttr(semantics::NO_SIL_VERIFICATION)) {
875-
return;
876-
}
877-
878869
// If SILOwnership is not enabled, do not perform verification.
879870
if (!getModule().getOptions().VerifySILOwnership)
880871
return;

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7430,10 +7430,6 @@ void SILFunction::verify(CalleeCache *calleeCache,
74307430
if (!verificationEnabled(getModule()))
74317431
return;
74327432

7433-
if (hasSemanticsAttr(semantics::NO_SIL_VERIFICATION)) {
7434-
return;
7435-
}
7436-
74377433
// Please put all checks in visitSILFunction in SILVerifier, not here. This
74387434
// ensures that the pretty stack trace in the verifier is included with the
74397435
// back trace when the verifier crashes.

lib/SILOptimizer/Utils/OptimizerBridging.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "swift/SILOptimizer/OptimizerBridging.h"
14-
#include "../../IRGen/IRGenModule.h"
15-
#include "swift/AST/SemanticAttrs.h"
16-
#include "swift/SIL/DynamicCasts.h"
17-
#include "swift/SIL/OSSALifetimeCompletion.h"
18-
#include "swift/SIL/SILCloner.h"
1914
#include "swift/SILOptimizer/Analysis/Analysis.h"
20-
#include "swift/SILOptimizer/IPO/ClosureSpecializer.h"
2115
#include "swift/SILOptimizer/Utils/CFGOptUtils.h"
2216
#include "swift/SILOptimizer/Utils/ConstantFolding.h"
2317
#include "swift/SILOptimizer/Utils/Devirtualize.h"
@@ -27,6 +21,11 @@
2721
#include "swift/SILOptimizer/Utils/SILOptFunctionBuilder.h"
2822
#include "swift/SILOptimizer/Utils/SpecializationMangler.h"
2923
#include "swift/SILOptimizer/Utils/StackNesting.h"
24+
#include "swift/SILOptimizer/IPO/ClosureSpecializer.h"
25+
#include "swift/SIL/DynamicCasts.h"
26+
#include "swift/SIL/OSSALifetimeCompletion.h"
27+
#include "swift/SIL/SILCloner.h"
28+
#include "../../IRGen/IRGenModule.h"
3029

3130
using namespace swift;
3231

@@ -64,10 +63,6 @@ void SILPassManager::runSwiftFunctionVerification(SILFunction *f) {
6463
if (DisableSwiftVerification)
6564
return;
6665

67-
if (f->hasSemanticsAttr(semantics::NO_SIL_VERIFICATION)) {
68-
return;
69-
}
70-
7166
getSwiftPassInvocation()->beginVerifyFunction(f);
7267
verifyFunctionFunction({getSwiftPassInvocation()}, {f});
7368
getSwiftPassInvocation()->endVerifyFunction();

test/SIL/verifier_nofail.sil

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,3 @@ bb0(%0 : $*P):
2323
%9999 = tuple()
2424
return %9999 : $()
2525
}
26-
27-
28-
class Klass {}
29-
30-
sil [ossa] [_semantics "sil.verify_none"] @foo : $@convention(thin) (@guaranteed Klass) -> () {
31-
bb0(%0 : @guaranteed $Klass):
32-
destroy_value %0
33-
%t = tuple()
34-
return %t
35-
}

0 commit comments

Comments
 (0)