summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2017-04-17 18:18:47 +0000
committerTim Northover <tnorthover@apple.com>2017-04-17 18:18:47 +0000
commit46e36f0953aabb5e5cd00ed8d296d60f9f71b424 (patch)
treed4cb837232a9aa5f332fb267923acf69986d5e7d /llvm/lib/Target/AArch64/AArch64Subtarget.cpp
parentceb30b0717456feeae9a6c9142169b9e39cc8eff (diff)
downloadbcm5719-llvm-46e36f0953aabb5e5cd00ed8d296d60f9f71b424.tar.gz
bcm5719-llvm-46e36f0953aabb5e5cd00ed8d296d60f9f71b424.zip
AArch64: put nonlazybind special handling behind a flag for now.
It's basically a terrible idea anyway but objc_msgSend gets emitted like that. We can decide on a better way to deal with it in the unlikely event that anyone actually uses it. llvm-svn: 300474
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64Subtarget.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64Subtarget.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
index e1815b7d3fa..042755bd36d 100644
--- a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
+++ b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
@@ -35,6 +35,11 @@ static cl::opt<bool>
UseAddressTopByteIgnored("aarch64-use-tbi", cl::desc("Assume that top byte of "
"an address is ignored"), cl::init(false), cl::Hidden);
+static cl::opt<bool>
+ UseNonLazyBind("aarch64-enable-nonlazybind",
+ cl::desc("Call nonlazybind functions via direct GOT load"),
+ cl::init(false), cl::Hidden);
+
AArch64Subtarget &
AArch64Subtarget::initializeSubtargetDependencies(StringRef FS,
StringRef CPUString) {
@@ -165,7 +170,7 @@ unsigned char AArch64Subtarget::classifyGlobalFunctionReference(
// NonLazyBind goes via GOT unless we know it's available locally.
auto *F = dyn_cast<Function>(GV);
- if (F && F->hasFnAttribute(Attribute::NonLazyBind) &&
+ if (UseNonLazyBind && F && F->hasFnAttribute(Attribute::NonLazyBind) &&
!TM.shouldAssumeDSOLocal(*GV->getParent(), GV))
return AArch64II::MO_GOT;
OpenPOWER on IntegriCloud