Re-apply "SIL: Remove special meaning for @_semantics("stdlib_binary_only")"

With -sil-serialize-all gone, this no longer means anything; just
don't declare the function as @_inlineable instead.

Fixes <rdar://problem/34564380>.
This commit is contained in:
Slava Pestov
2017-10-02 20:18:59 -07:00
parent d558168a42
commit c272d41e2f
19 changed files with 38 additions and 134 deletions

View File

@@ -26,26 +26,6 @@ using namespace Lowering;
STATISTIC(NumFuncLinked, "Number of SIL functions linked");
//===----------------------------------------------------------------------===//
// Utility
//===----------------------------------------------------------------------===//
/// \return True if the function \p F should be imported into the current
/// module.
static bool shouldImportFunction(SILFunction *F) {
// Skip functions that are marked with the 'no import' tag. These
// are functions that we don't want to copy from the module.
if (F->hasSemanticsAttr("stdlib_binary_only")) {
// If we are importing a function declaration mark it as external since we
// are not importing the body.
if (F->isExternalDeclaration())
F->setLinkage(SILLinkage::PublicExternal);
return false;
}
return true;
}
//===----------------------------------------------------------------------===//
// Linker Helpers
//===----------------------------------------------------------------------===//
@@ -55,9 +35,6 @@ bool SILLinkerVisitor::processFunction(SILFunction *F) {
if (Mode == LinkingMode::LinkNone)
return false;
if (!shouldImportFunction(F))
return false;
// If F is a declaration, first deserialize it.
if (F->isExternalDeclaration()) {
auto *NewFn = Loader->lookupSILFunction(F);
@@ -334,9 +311,6 @@ bool SILLinkerVisitor::process() {
while (!Worklist.empty()) {
auto *Fn = Worklist.pop_back_val();
if (!shouldImportFunction(Fn))
continue;
DEBUG(llvm::dbgs() << "Process imports in function: "
<< Fn->getName() << "\n");
@@ -346,9 +320,6 @@ bool SILLinkerVisitor::process() {
if (visit(&I)) {
for (auto *F : FunctionDeserializationWorklist) {
if (!shouldImportFunction(F))
continue;
DEBUG(llvm::dbgs() << "Imported function: "
<< F->getName() << "\n");
F->setBare(IsBare);