mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix linkage of 'static inline' Clang-imported definitions
If an external SIL function has a Clang-generated body, I think this means we have a static function, and we want to use Shared linkage, not Public. Add a new flag to SILFunction for this and plumb it through to appease assertions from SILVerifier. Swift SVN r31763
This commit is contained in:
@@ -359,10 +359,14 @@ SILFunction *SILModule::getOrCreateFunction(SILLocation loc,
|
||||
F->setDebugScope(new (*this) SILDebugScope(loc, *F));
|
||||
|
||||
F->setGlobalInit(constant.isGlobal());
|
||||
if (constant.hasDecl())
|
||||
if (constant.hasDecl()) {
|
||||
if (constant.isForeign && constant.isClangGenerated())
|
||||
F->setForeignBody(HasForeignBody);
|
||||
|
||||
if (auto SemanticsA =
|
||||
constant.getDecl()->getAttrs().getAttribute<SemanticsAttr>())
|
||||
F->setSemanticsAttr(SemanticsA->Value);
|
||||
}
|
||||
|
||||
F->setDeclContext(constant.hasDecl() ? constant.getDecl() : nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user