if (TM.getRelocationModel() != Reloc::Static &&
TM.getCodeModel() != CodeModel::Large) {
if (isTargetDarwin()) {
- if (!isDirectCall)
- return false;
bool isDecl = GV->isDeclaration() && !GV->hasNotBeenReadFromBitcode();
if (GV->hasHiddenVisibility() &&
(Is64Bit || (!isDecl && !GV->hasCommonLinkage())))
// target is x86-64 or the symbol is definitely defined in the current
// translation unit.
return false;
- return isDecl || GV->mayBeOverridden();
+ return !isDirectCall && (isDecl || GV->mayBeOverridden());
} else if (isTargetELF()) {
// Extra load is needed for all externally visible.
if (isDirectCall)