diff options
| author | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2011-07-18 04:54:35 +0000 |
| commit | 229907cd11658776a6c7451de74b9e16ba637d9c (patch) | |
| tree | 56a83033fb7b2337bf90a7b23ca87e9a0e8b62f7 /llvm/lib/Transforms/Utils/AddrModeMatcher.cpp | |
| parent | 805d09459df33da12c3dc3cf6ab7806baebbe4c8 (diff) | |
| download | bcm5719-llvm-229907cd11658776a6c7451de74b9e16ba637d9c.tar.gz bcm5719-llvm-229907cd11658776a6c7451de74b9e16ba637d9c.zip | |
land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
Diffstat (limited to 'llvm/lib/Transforms/Utils/AddrModeMatcher.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Utils/AddrModeMatcher.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp b/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp index be7bed1cecd..8e5a1eb2c84 100644 --- a/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp +++ b/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp @@ -222,7 +222,7 @@ bool AddressingModeMatcher::MatchOperationAddr(User *AddrInst, unsigned Opcode, const TargetData *TD = TLI.getTargetData(); gep_type_iterator GTI = gep_type_begin(AddrInst); for (unsigned i = 1, e = AddrInst->getNumOperands(); i != e; ++i, ++GTI) { - if (const StructType *STy = dyn_cast<StructType>(*GTI)) { + if (StructType *STy = dyn_cast<StructType>(*GTI)) { const StructLayout *SL = TD->getStructLayout(STy); unsigned Idx = cast<ConstantInt>(AddrInst->getOperand(i))->getZExtValue(); @@ -557,7 +557,7 @@ IsProfitableToFoldIntoAddressingMode(Instruction *I, ExtAddrMode &AMBefore, Value *Address = User->getOperand(OpNo); if (!Address->getType()->isPointerTy()) return false; - const Type *AddressAccessTy = + Type *AddressAccessTy = cast<PointerType>(Address->getType())->getElementType(); // Do a match against the root of this address, ignoring profitability. This |

