Add @_weakLinked and a corresponding SIL attribute

This is mostly intended to be used for testing at this point; in the
long run, we want to be using availability information to decide
whether to weak-link something or not. You'll notice a bunch of FIXMEs
in the test case that we may not need now, but will probably need to
handle in the future.

Groundwork for doing backward-deployment execution tests.
This commit is contained in:
Jordan Rose
2018-02-20 17:55:31 -08:00
parent a036033f9a
commit bb339778b4
18 changed files with 353 additions and 19 deletions

View File

@@ -310,6 +310,9 @@ static void addFunctionAttributes(SILFunction *F, DeclAttributes &Attrs,
if (Attrs.hasAttribute<SILGenNameAttr>() ||
Attrs.hasAttribute<CDeclAttr>())
F->setHasCReferences(true);
if (Attrs.hasAttribute<WeakLinkedAttr>())
F->setWeakLinked();
}
SILFunction *SILModule::getOrCreateFunction(SILLocation loc,