mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user