|
19 | 19 | #include "swift/SIL/SILCloner.h"
|
20 | 20 | #include "swift/SILOptimizer/PassManager/Passes.h"
|
21 | 21 | #include "swift/SILOptimizer/PassManager/Transforms.h"
|
| 22 | +#include "swift/SILOptimizer/Utils/InstOptUtils.h" |
22 | 23 | #include "swift/SILOptimizer/Utils/SILOptFunctionBuilder.h"
|
23 | 24 | #include "swift/SILOptimizer/Utils/SpecializationMangler.h"
|
24 | 25 | #include "swift/SILOptimizer/Utils/StackNesting.h"
|
@@ -633,11 +634,12 @@ SILFunction *PromotedParamCloner::initCloned(SILOptFunctionBuilder &FuncBuilder,
|
633 | 634 | && "SILFunction missing DebugScope");
|
634 | 635 | assert(!Orig->isGlobalInit() && "Global initializer cannot be cloned");
|
635 | 636 | auto *Fn = FuncBuilder.createFunction(
|
636 |
| - SILLinkage::Shared, ClonedName, ClonedTy, Orig->getGenericEnvironment(), |
637 |
| - Orig->getLocation(), Orig->isBare(), Orig->isTransparent(), Serialized, |
638 |
| - IsNotDynamic, Orig->getEntryCount(), Orig->isThunk(), |
639 |
| - Orig->getClassSubclassScope(), Orig->getInlineStrategy(), |
640 |
| - Orig->getEffectsKind(), Orig, Orig->getDebugScope()); |
| 637 | + swift::getSpecializedLinkage(Orig, Orig->getLinkage()), ClonedName, |
| 638 | + ClonedTy, Orig->getGenericEnvironment(), Orig->getLocation(), |
| 639 | + Orig->isBare(), Orig->isTransparent(), Serialized, IsNotDynamic, |
| 640 | + Orig->getEntryCount(), Orig->isThunk(), Orig->getClassSubclassScope(), |
| 641 | + Orig->getInlineStrategy(), Orig->getEffectsKind(), Orig, |
| 642 | + Orig->getDebugScope()); |
641 | 643 | for (auto &Attr : Orig->getSemanticsAttrs()) {
|
642 | 644 | Fn->addSemanticsAttr(Attr);
|
643 | 645 | }
|
|
0 commit comments