[deserialization] When linking functions, return failure if we get back a declaration.

We consider linking to only succeed if we actually convert a declaration
into a definition.

Swift SVN r15070
This commit is contained in:
Michael Gottesman
2014-03-14 20:36:17 +00:00
parent 641e4d8b6a
commit 11c03b0482

View File

@@ -257,7 +257,7 @@ bool SILModule::linkFunction(SILFunction *Fun, SILModule::LinkingMode Mode) {
bool LinkAll = Mode == LinkingMode::LinkAll;
// First attempt to link in Fun. If we fail, bail.
auto NewFn = SILLoader->lookupSILFunction(Fun);
if (!NewFn)
if (!NewFn || NewFn->empty())
return false;
++NumFuncLinked;