diff options
author | Tanya Lattner <tonic@nondot.org> | 2009-09-12 22:49:19 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2009-09-12 22:49:19 +0000 |
commit | d76a68e5a71ffe5fdc940092bfbd001c1eb6227e (patch) | |
tree | 7a2baa5784e50cadea448f14118da4a70a3825b8 /lib/Target/ARM/ARMSubtarget.cpp | |
parent | 031fdbb7e8a406dbfc5cf57f6aa5e1b75d31d285 (diff) |
Merge 80404 from mainline.
Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of nasty code in ARM asm printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_26@81647 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMSubtarget.cpp')
-rw-r--r-- | lib/Target/ARM/ARMSubtarget.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index ba63ff42ca..67669cc7b8 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -13,6 +13,7 @@ #include "ARMSubtarget.h" #include "ARMGenSubtarget.inc" +#include "llvm/GlobalValue.h" #include "llvm/Target/TargetOptions.h" #include "llvm/Support/CommandLine.h" using namespace llvm; @@ -92,3 +93,13 @@ ARMSubtarget::ARMSubtarget(const std::string &TT, const std::string &FS, if (isTargetDarwin()) IsR9Reserved = ReserveR9 | (ARMArchVersion < V6); } + +/// GVIsIndirectSymbol - true if the GV will be accessed via an indirect symbol. +bool ARMSubtarget::GVIsIndirectSymbol(GlobalValue *GV, bool isStatic) const { + // If symbol visibility is hidden, the extra load is not needed if + // the symbol is definitely defined in the current translation unit. + bool isDecl = GV->isDeclaration() || GV->hasAvailableExternallyLinkage(); + if (GV->hasHiddenVisibility() && (!isDecl && !GV->hasCommonLinkage())) + return false; + return !isStatic && (isDecl || GV->isWeakForLinker()); +} |