Re-apply 60689 now my head is screwed on right.

llvm-svn: 60711
This commit is contained in:
Evan Cheng 2008-12-08 19:29:03 +00:00
parent 6f3258586e
commit 3bb2ad8a0a

View File

@ -40,6 +40,8 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
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())))