Prespecialization: reduce the strength of an assertion.

If we find a specialization within the current module, it's okay if it
has a body. This can come up if we compile something with optimizations
and then compile the resulting SIL (or SIB) without optimizations.
This commit is contained in:
Jordan Rose
2016-04-20 16:13:47 -07:00
parent af874abdbf
commit e1126b36e5
2 changed files with 40 additions and 3 deletions

View File

@@ -135,15 +135,14 @@ bool UsePrespecialized::replaceByPrespecialized(SILFunction &F) {
<< PrevF << "\n");
if (!PrevF)
continue;
assert(PrevF->isExternalDeclaration() &&
"Prespecialized function should be an external declaration");
NewF = PrevF;
}
if (!NewF)
continue;
assert(NewF->isExternalDeclaration() &&
"Prespecialized function should be an external declaration");
// An existing specialization was found.
DEBUG(llvm::dbgs() << "Found a specialization of " << ReferencedF->getName()
<< " : " << NewF->getName() << "\n");