summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2011-07-11 07:56:41 +0000
committerJay Foad <jay.foad@gmail.com>2011-07-11 07:56:41 +0000
commitf362affa3a695164a94d275fb44d18f44ebb855a (patch)
treec07a3ce28c975fcda45c377276692e508f0dc79a /lib/Transforms/Scalar
parent7f0ce349187e6526ed2d92fe7d2757f84f73ce04 (diff)
downloadllvm-f362affa3a695164a94d275fb44d18f44ebb855a.tar.gz
llvm-f362affa3a695164a94d275fb44d18f44ebb855a.tar.bz2
llvm-f362affa3a695164a94d275fb44d18f44ebb855a.tar.xz
De-constify Types in FunctionType::get().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r--lib/Transforms/Scalar/MemCpyOptimizer.cpp6
-rw-r--r--lib/Transforms/Scalar/ObjCARC.cpp28
-rw-r--r--lib/Transforms/Scalar/SimplifyLibCalls.cpp2
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index bd4c2d6d8e..a3a3063cde 100644
--- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -840,9 +840,9 @@ bool MemCpyOpt::processMemMove(MemMoveInst *M) {
// If not, then we know we can transform this.
Module *Mod = M->getParent()->getParent()->getParent();
- const Type *ArgTys[3] = { M->getRawDest()->getType(),
- M->getRawSource()->getType(),
- M->getLength()->getType() };
+ Type *ArgTys[3] = { M->getRawDest()->getType(),
+ M->getRawSource()->getType(),
+ M->getLength()->getType() };
M->setCalledFunction(Intrinsic::getDeclaration(Mod, Intrinsic::memcpy,
ArgTys, 3));
diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp
index 89a451ef7a..6e3e0f86b6 100644
--- a/lib/Transforms/Scalar/ObjCARC.cpp
+++ b/lib/Transforms/Scalar/ObjCARC.cpp
@@ -1498,8 +1498,8 @@ void ObjCARCOpt::getAnalysisUsage(AnalysisUsage &AU) const {
Constant *ObjCARCOpt::getRetainRVCallee(Module *M) {
if (!RetainRVCallee) {
LLVMContext &C = M->getContext();
- const Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
- std::vector<const Type *> Params;
+ Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
+ std::vector<Type *> Params;
Params.push_back(I8X);
const FunctionType *FTy =
FunctionType::get(I8X, Params, /*isVarArg=*/false);
@@ -1515,8 +1515,8 @@ Constant *ObjCARCOpt::getRetainRVCallee(Module *M) {
Constant *ObjCARCOpt::getAutoreleaseRVCallee(Module *M) {
if (!AutoreleaseRVCallee) {
LLVMContext &C = M->getContext();
- const Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
- std::vector<const Type *> Params;
+ Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
+ std::vector<Type *> Params;
Params.push_back(I8X);
const FunctionType *FTy =
FunctionType::get(I8X, Params, /*isVarArg=*/false);
@@ -1532,7 +1532,7 @@ Constant *ObjCARCOpt::getAutoreleaseRVCallee(Module *M) {
Constant *ObjCARCOpt::getReleaseCallee(Module *M) {
if (!ReleaseCallee) {
LLVMContext &C = M->getContext();
- std::vector<const Type *> Params;
+ std::vector<Type *> Params;
Params.push_back(PointerType::getUnqual(Type::getInt8Ty(C)));
AttrListPtr Attributes;
Attributes.addAttr(~0u, Attribute::NoUnwind);
@@ -1548,7 +1548,7 @@ Constant *ObjCARCOpt::getReleaseCallee(Module *M) {
Constant *ObjCARCOpt::getRetainCallee(Module *M) {
if (!RetainCallee) {
LLVMContext &C = M->getContext();
- std::vector<const Type *> Params;
+ std::vector<Type *> Params;
Params.push_back(PointerType::getUnqual(Type::getInt8Ty(C)));
AttrListPtr Attributes;
Attributes.addAttr(~0u, Attribute::NoUnwind);
@@ -1564,7 +1564,7 @@ Constant *ObjCARCOpt::getRetainCallee(Module *M) {
Constant *ObjCARCOpt::getAutoreleaseCallee(Module *M) {
if (!AutoreleaseCallee) {
LLVMContext &C = M->getContext();
- std::vector<const Type *> Params;
+ std::vector<Type *> Params;
Params.push_back(PointerType::getUnqual(Type::getInt8Ty(C)));
AttrListPtr Attributes;
Attributes.addAttr(~0u, Attribute::NoUnwind);
@@ -3269,9 +3269,9 @@ void ObjCARCContract::getAnalysisUsage(AnalysisUsage &AU) const {
Constant *ObjCARCContract::getStoreStrongCallee(Module *M) {
if (!StoreStrongCallee) {
LLVMContext &C = M->getContext();
- const Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
- const Type *I8XX = PointerType::getUnqual(I8X);
- std::vector<const Type *> Params;
+ Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
+ Type *I8XX = PointerType::getUnqual(I8X);
+ std::vector<Type *> Params;
Params.push_back(I8XX);
Params.push_back(I8X);
@@ -3291,8 +3291,8 @@ Constant *ObjCARCContract::getStoreStrongCallee(Module *M) {
Constant *ObjCARCContract::getRetainAutoreleaseCallee(Module *M) {
if (!RetainAutoreleaseCallee) {
LLVMContext &C = M->getContext();
- const Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
- std::vector<const Type *> Params;
+ Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
+ std::vector<Type *> Params;
Params.push_back(I8X);
const FunctionType *FTy =
FunctionType::get(I8X, Params, /*isVarArg=*/false);
@@ -3307,8 +3307,8 @@ Constant *ObjCARCContract::getRetainAutoreleaseCallee(Module *M) {
Constant *ObjCARCContract::getRetainAutoreleaseRVCallee(Module *M) {
if (!RetainAutoreleaseRVCallee) {
LLVMContext &C = M->getContext();
- const Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
- std::vector<const Type *> Params;
+ Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
+ std::vector<Type *> Params;
Params.push_back(I8X);
const FunctionType *FTy =
FunctionType::get(I8X, Params, /*isVarArg=*/false);
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
index 6247b0348f..66c3028441 100644
--- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp
+++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp
@@ -992,7 +992,7 @@ struct FFSOpt : public LibCallOptimization {
}
// ffs(x) -> x != 0 ? (i32)llvm.cttz(x)+1 : 0
- const Type *ArgType = Op->getType();
+ Type *ArgType = Op->getType();
Value *F = Intrinsic::getDeclaration(Callee->getParent(),
Intrinsic::cttz, &ArgType, 1);
Value *V = B.CreateCall(F, Op, "cttz");