summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2017-04-04 19:51:53 +0000
committerPetr Hosek <phosek@chromium.org>2017-04-04 19:51:53 +0000
commit9eb0a1e09b1eeece9c59e8ee6c5164fcd6bbcacb (patch)
treee15d0b73dafc479fcb2f5918c89eed926e5e5013 /llvm/lib/Target/AArch64/AArch64Subtarget.cpp
parentc45b03bddcff957a5353007f11dc520fd0072adc (diff)
downloadbcm5719-llvm-9eb0a1e09b1eeece9c59e8ee6c5164fcd6bbcacb.tar.gz
bcm5719-llvm-9eb0a1e09b1eeece9c59e8ee6c5164fcd6bbcacb.zip
[AArch64][Fuchsia] Allow -mcmodel=kernel for --target=aarch64-fuchsia
This mode is just like -mcmodel=small except that it moves the thread pointer from TPIDR_EL0 to TPIDR_EL1. Patch by Roland McGrath. Differential Revision: https://reviews.llvm.org/D31624 llvm-svn: 299462
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64Subtarget.cpp')
-rw-r--r--llvm/lib/Target/AArch64/AArch64Subtarget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
index a9222c43476..b3aba4781db 100644
--- a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
+++ b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp
@@ -147,9 +147,9 @@ AArch64Subtarget::ClassifyGlobalReference(const GlobalValue *GV,
if (!TM.shouldAssumeDSOLocal(*GV->getParent(), GV))
return AArch64II::MO_GOT;
- // The small code mode's direct accesses use ADRP, which cannot necessarily
- // produce the value 0 (if the code is above 4GB).
- if (TM.getCodeModel() == CodeModel::Small && GV->hasExternalWeakLinkage())
+ // The small code model's direct accesses use ADRP, which cannot
+ // necessarily produce the value 0 (if the code is above 4GB).
+ if (useSmallAddressing() && GV->hasExternalWeakLinkage())
return AArch64II::MO_GOT;
return AArch64II::MO_NO_FLAG;
OpenPOWER on IntegriCloud