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/Target/ARM/ARMGlobalMerge.cpp | |
| parent | 805d09459df33da12c3dc3cf6ab7806baebbe4c8 (diff) | |
| download | llvm-229907cd11658776a6c7451de74b9e16ba637d9c.zip llvm-229907cd11658776a6c7451de74b9e16ba637d9c.tar.gz llvm-229907cd11658776a6c7451de74b9e16ba637d9c.tar.bz2 | |
land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
Diffstat (limited to 'llvm/lib/Target/ARM/ARMGlobalMerge.cpp')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMGlobalMerge.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/ARM/ARMGlobalMerge.cpp b/llvm/lib/Target/ARM/ARMGlobalMerge.cpp index 8d77b2d..e4b732c 100644 --- a/llvm/lib/Target/ARM/ARMGlobalMerge.cpp +++ b/llvm/lib/Target/ARM/ARMGlobalMerge.cpp @@ -100,8 +100,8 @@ namespace { GlobalCmp(const TargetData *td) : TD(td) { } bool operator()(const GlobalVariable *GV1, const GlobalVariable *GV2) { - const Type *Ty1 = cast<PointerType>(GV1->getType())->getElementType(); - const Type *Ty2 = cast<PointerType>(GV2->getType())->getElementType(); + Type *Ty1 = cast<PointerType>(GV1->getType())->getElementType(); + Type *Ty2 = cast<PointerType>(GV2->getType())->getElementType(); return (TD->getTypeAllocSize(Ty1) < TD->getTypeAllocSize(Ty2)); } @@ -123,7 +123,7 @@ bool ARMGlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &Globals, // FIXME: Find better heuristics std::stable_sort(Globals.begin(), Globals.end(), GlobalCmp(TD)); - const Type *Int32Ty = Type::getInt32Ty(M.getContext()); + Type *Int32Ty = Type::getInt32Ty(M.getContext()); for (size_t i = 0, e = Globals.size(); i != e; ) { size_t j = 0; @@ -176,7 +176,7 @@ bool ARMGlobalMerge::doInitialization(Module &M) { // Ignore fancy-aligned globals for now. unsigned Alignment = I->getAlignment(); - const Type *Ty = I->getType()->getElementType(); + Type *Ty = I->getType()->getElementType(); if (Alignment > TD->getABITypeAlignment(Ty)) continue; |
