summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreISelLowering.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2015-07-09 02:09:40 +0000
committerMehdi Amini <mehdi.amini@apple.com>2015-07-09 02:09:40 +0000
commit0cdec1e2ab5c3d8e2d546330883b84cc6b9661ae (patch)
tree93ac6bed67874e854d8b3194623817adbb080800 /llvm/lib/Target/XCore/XCoreISelLowering.cpp
parent5c183d5239f506aad444bddcd158321f5fea0e2f (diff)
downloadbcm5719-llvm-0cdec1e2ab5c3d8e2d546330883b84cc6b9661ae.tar.gz
bcm5719-llvm-0cdec1e2ab5c3d8e2d546330883b84cc6b9661ae.zip
Make isLegalAddressingMode() taking DataLayout as an argument
Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: jholewinski, llvm-commits, rafael, yaron.keren Differential Revision: http://reviews.llvm.org/D11040 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 241778
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreISelLowering.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreISelLowering.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
index f99136dcd31..03ce62ad798 100644
--- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp
+++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp
@@ -1923,15 +1923,13 @@ static inline bool isImmUs4(int64_t val)
/// isLegalAddressingMode - Return true if the addressing mode represented
/// by AM is legal for this target, for a load/store of the specified type.
-bool
-XCoreTargetLowering::isLegalAddressingMode(const AddrMode &AM,
- Type *Ty,
- unsigned AS) const {
+bool XCoreTargetLowering::isLegalAddressingMode(const DataLayout &DL,
+ const AddrMode &AM, Type *Ty,
+ unsigned AS) const {
if (Ty->getTypeID() == Type::VoidTyID)
return AM.Scale == 0 && isImmUs(AM.BaseOffs) && isImmUs4(AM.BaseOffs);
- const DataLayout *TD = TM.getDataLayout();
- unsigned Size = TD->getTypeAllocSize(Ty);
+ unsigned Size = DL.getTypeAllocSize(Ty);
if (AM.BaseGV) {
return Size >= 4 && !AM.HasBaseReg && AM.Scale == 0 &&
AM.BaseOffs%4 == 0;
OpenPOWER on IntegriCloud