@@ -764,19 +764,9 @@ IRGenModule::getAddrOfContextDescriptorForParent(DeclContext *parent,
764
764
// descriptor, so we'll just emit an extension context.
765
765
auto clas = dyn_cast<ClassDecl>(nominal);
766
766
if (!clas || clas->isForeign () || hasKnownSwiftMetadata (*this , clas)) {
767
- // Some targets don't support relative references to undefined symbols.
768
- // If the extension is in a different file from the original type
769
- // declaration, it may not get emitted in this TU. Use an indirect
770
- // reference to work around the object format limitation.
771
- auto shouldBeIndirect =
772
- parent->getModuleScopeContext () != ofChild->getModuleScopeContext ()
773
- ? ConstantReference::Indirect
774
- : ConstantReference::Direct;
775
-
776
767
IRGen.noteUseOfTypeContextDescriptor (nominal, DontRequireMetadata);
777
768
return getAddrOfLLVMVariableOrGOTEquivalent (
778
- LinkEntity::forNominalTypeDescriptor (nominal),
779
- shouldBeIndirect);
769
+ LinkEntity::forNominalTypeDescriptor (nominal));
780
770
}
781
771
}
782
772
return {getAddrOfExtensionContextDescriptor (ext),
@@ -2870,8 +2860,7 @@ IRGenModule::getAddrOfLLVMVariable(LinkEntity entity,
2870
2860
// / global variable. LLVM can replace relative references to this variable with
2871
2861
// / relative references to the GOT entry for the variable in the object file.
2872
2862
ConstantReference
2873
- IRGenModule::getAddrOfLLVMVariableOrGOTEquivalent (LinkEntity entity,
2874
- ConstantReference::Directness forceIndirectness) {
2863
+ IRGenModule::getAddrOfLLVMVariableOrGOTEquivalent (LinkEntity entity) {
2875
2864
// Handle SILFunctions specially, because unlike other entities they aren't
2876
2865
// variables and aren't kept in the GlobalVars table.
2877
2866
if (entity.isSILFunction ()) {
@@ -2934,10 +2923,6 @@ IRGenModule::getAddrOfLLVMVariableOrGOTEquivalent(LinkEntity entity,
2934
2923
return {gotEquivalent, ConstantReference::Indirect};
2935
2924
};
2936
2925
2937
- // Return the GOT entry if we were asked to.
2938
- if (forceIndirectness == ConstantReference::Indirect)
2939
- return indirect ();
2940
-
2941
2926
// The integrated REPL incrementally adds new definitions, so always use
2942
2927
// indirect references in this mode.
2943
2928
if (IRGen.Opts .IntegratedREPL )
0 commit comments