summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-09-03 11:59:23 +0000
committerMartin Storsjo <martin@martin.st>2018-09-03 11:59:23 +0000
commit5c984fb16d7d27c3522cf7eeb1b1805e867af499 (patch)
tree683053c187494ae4b2b626e21f46f67b68721997 /llvm/lib
parent73ae7cb4f12fb939a52fa16b12baa8afa48821cc (diff)
downloadbcm5719-llvm-5c984fb16d7d27c3522cf7eeb1b1805e867af499.tar.gz
bcm5719-llvm-5c984fb16d7d27c3522cf7eeb1b1805e867af499.zip
[AArch64] Simplify code in LowerGlobalAddress. NFCI.
When initial support for dllimport was added for aarch64 in SVN r316555, ClassifyGlobalReference didn't set the MO_DLLIMPORT flag - that was only completed in SVN r323810. Reuse the return value from ClassifyGlobalReference for this purpose as well. llvm-svn: 341310
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 438a7a4eee8..a3e2edf1453 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -3928,9 +3928,6 @@ SDValue AArch64TargetLowering::LowerGlobalAddress(SDValue Op,
SelectionDAG &DAG) const {
GlobalAddressSDNode *GN = cast<GlobalAddressSDNode>(Op);
const GlobalValue *GV = GN->getGlobal();
- const AArch64II::TOF TargetFlags =
- (GV->hasDLLImportStorageClass() ? AArch64II::MO_DLLIMPORT
- : AArch64II::MO_NO_FLAG);
unsigned char OpFlags =
Subtarget->ClassifyGlobalReference(GV, getTargetMachine());
@@ -3941,16 +3938,16 @@ SDValue AArch64TargetLowering::LowerGlobalAddress(SDValue Op,
// This also catches the large code model case for Darwin, and tiny code
// model with got relocations.
if ((OpFlags & AArch64II::MO_GOT) != 0) {
- return getGOT(GN, DAG, TargetFlags);
+ return getGOT(GN, DAG, OpFlags);
}
SDValue Result;
if (getTargetMachine().getCodeModel() == CodeModel::Large) {
- Result = getAddrLarge(GN, DAG, TargetFlags);
+ Result = getAddrLarge(GN, DAG, OpFlags);
} else if (getTargetMachine().getCodeModel() == CodeModel::Tiny) {
- Result = getAddrTiny(GN, DAG, TargetFlags);
+ Result = getAddrTiny(GN, DAG, OpFlags);
} else {
- Result = getAddr(GN, DAG, TargetFlags);
+ Result = getAddr(GN, DAG, OpFlags);
}
EVT PtrVT = getPointerTy(DAG.getDataLayout());
SDLoc DL(GN);
OpenPOWER on IntegriCloud