1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Start using shouldAssumeDSOLocal on ARM.

Given where this is used it should be a nop.

llvm-svn: 271066
This commit is contained in:
Rafael Espindola 2016-05-27 22:41:51 +00:00
parent 08ff5714ba
commit 0474b584d9

View File

@ -22,6 +22,7 @@
#include "Thumb1FrameLowering.h" #include "Thumb1FrameLowering.h"
#include "Thumb1InstrInfo.h" #include "Thumb1InstrInfo.h"
#include "Thumb2InstrInfo.h" #include "Thumb2InstrInfo.h"
#include "llvm/CodeGen/Analysis.h"
#include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Attributes.h" #include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h" #include "llvm/IR/Function.h"
@ -273,40 +274,19 @@ bool ARMSubtarget::isAAPCS16_ABI() const {
return TM.TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16; return TM.TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
} }
/// true if the GV will be accessed via an indirect symbol.
/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect symbol.
bool bool
ARMSubtarget::GVIsIndirectSymbol(const GlobalValue *GV, ARMSubtarget::GVIsIndirectSymbol(const GlobalValue *GV,
Reloc::Model RelocM) const { Reloc::Model RelocM) const {
if (RelocM == Reloc::Static) if (!shouldAssumeDSOLocal(RelocM, TargetTriple, *GV->getParent(), GV))
return false;
bool isDef = GV->isStrongDefinitionForLinker();
if (!isTargetMachO()) {
// Extra load is needed for all externally visible.
if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
return false;
return true; return true;
} else {
// If this is a strong reference to a definition, it is definitely not
// through a stub.
if (isDef)
return false;
// Unless we have a symbol with hidden visibility, we have to go through a // 32 bit macho has no relocation for a-b if a is undefined, even if b is in
// normal $non_lazy_ptr stub because this symbol might be resolved late. // the section that is being relocated. This means we have to use o load even
if (!GV->hasHiddenVisibility()) // Non-hidden $non_lazy_ptr reference. // for GVs that are known to be local to the dso.
return true; if (isTargetDarwin() && RelocM == Reloc::PIC_ &&
(GV->isDeclarationForLinker() || GV->hasCommonLinkage()))
if (RelocM == Reloc::PIC_) { return true;
// If symbol visibility is hidden, we have a stub for common symbol
// references and external declarations.
if (GV->isDeclarationForLinker() || GV->hasCommonLinkage())
// Hidden $non_lazy_ptr reference.
return true;
}
}
return false; return false;
} }