6060#include " swift/AST/ProtocolConformance.h"
6161#include " swift/AST/SubstitutionMap.h"
6262#include " swift/Basic/Assertions.h"
63- #include " swift/Basic/Require.h"
6463#include " swift/ClangImporter/ClangModule.h"
6564#include " swift/SIL/FormalLinkage.h"
6665#include " swift/Serialization/SerializedSILLoader.h"
@@ -76,20 +75,20 @@ STATISTIC(NumFuncLinked, "Number of SIL functions linked");
7675// ===----------------------------------------------------------------------===//
7776
7877void SILLinkerVisitor::deserializeAndPushToWorklist (SILFunction *F) {
79- assert (F->isExternalDeclaration ());
78+ ASSERT (F->isExternalDeclaration ());
8079
8180 LLVM_DEBUG (llvm::dbgs () << " Imported function: "
8281 << F->getName () << " \n " );
8382 SILFunction *NewF =
8483 Mod.getSILLoader ()->lookupSILFunction (F, /* onlyUpdateLinkage*/ false );
85- assert (!NewF || NewF == F);
84+ ASSERT (!NewF || NewF == F);
8685 if (!NewF || F->isExternalDeclaration ()) {
87- assert ((!hasSharedVisibility (F->getLinkage ()) || F->hasForeignBody ()) &&
86+ ASSERT ((!hasSharedVisibility (F->getLinkage ()) || F->hasForeignBody ()) &&
8887 " cannot deserialize shared function" );
8988 return ;
9089 }
9190
92- assert (!F->isAnySerialized () == Mod.isSerialized () &&
91+ ASSERT (!F->isAnySerialized () == Mod.isSerialized () &&
9392 " the de-serializer did set the wrong serialized flag" );
9493
9594 F->setBare (IsBare);
@@ -103,9 +102,9 @@ void SILLinkerVisitor::deserializeAndPushToWorklist(SILFunction *F) {
103102void SILLinkerVisitor::maybeAddFunctionToWorklist (
104103 SILFunction *F, SerializedKind_t callerSerializedKind) {
105104 SILLinkage linkage = F->getLinkage ();
106- require (callerSerializedKind == IsNotSerialized ||
105+ ASSERT ( (callerSerializedKind == IsNotSerialized ||
107106 F->hasValidLinkageForFragileRef (callerSerializedKind) ||
108- hasSharedVisibility (linkage) || F->isExternForwardDeclaration (),
107+ hasSharedVisibility (linkage) || F->isExternForwardDeclaration ()) &&
109108 " called function has wrong linkage for serialized function" );
110109 if (!F->isExternalDeclaration ()) {
111110 // The function is already in the module, so no need to de-serialized it.
@@ -175,7 +174,7 @@ void SILLinkerVisitor::linkInVTable(ClassDecl *D) {
175174 // vtables that might have shared linkage yet, so this is only needed in
176175 // the performance pipeline to deserialize more functions early, and expose
177176 // optimization opportunities.
178- assert (isLinkAll ());
177+ ASSERT (isLinkAll ());
179178
180179 // Attempt to lookup the Vtbl from the SILModule.
181180 SILVTable *Vtbl = Mod.lookUpVTable (D);
0 commit comments