diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-09 02:09:20 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-09 02:09:20 +0000 |
commit | 9639d650bbf60345ed174787039d5463ab4fc927 (patch) | |
tree | aa8d8f5563a168fe71fcd74c3aed8641c8c94aea /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
parent | 44ede33a697db70dc1b9f398a51d8dfd5b87efc1 (diff) | |
download | llvm-9639d650bbf60345ed174787039d5463ab4fc927.zip llvm-9639d650bbf60345ed174787039d5463ab4fc927.tar.gz llvm-9639d650bbf60345ed174787039d5463ab4fc927.tar.bz2 |
Make TargetLowering::getShiftAmountTy() 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/D11037
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 241776
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 1d0b988..d260358 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -878,15 +878,16 @@ void TargetLoweringBase::initActions() { setOperationAction(ISD::DEBUGTRAP, MVT::Other, Expand); } -MVT TargetLoweringBase::getScalarShiftAmountTy(EVT LHSTy) const { - return MVT::getIntegerVT(8 * getDataLayout()->getPointerSize(0)); +MVT TargetLoweringBase::getScalarShiftAmountTy(const DataLayout &DL) const { + return MVT::getIntegerVT(8 * DL.getPointerSize(0)); } -EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy) const { +EVT TargetLoweringBase::getShiftAmountTy(EVT LHSTy, + const DataLayout &DL) const { assert(LHSTy.isInteger() && "Shift amount is not an integer type!"); if (LHSTy.isVector()) return LHSTy; - return getScalarShiftAmountTy(LHSTy); + return getScalarShiftAmountTy(DL); } /// canOpTrap - Returns true if the operation can trap for the value type. |