diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-07-11 07:56:41 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-07-11 07:56:41 +0000 |
commit | f362affa3a695164a94d275fb44d18f44ebb855a (patch) | |
tree | c07a3ce28c975fcda45c377276692e508f0dc79a /lib/VMCore | |
parent | 7f0ce349187e6526ed2d92fe7d2757f84f73ce04 (diff) | |
download | llvm-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/VMCore')
-rw-r--r-- | lib/VMCore/Core.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Function.cpp | 8 | ||||
-rw-r--r-- | lib/VMCore/IRBuilder.cpp | 6 | ||||
-rw-r--r-- | lib/VMCore/Module.cpp | 8 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 9 |
5 files changed, 13 insertions, 20 deletions
diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index d9ced94134..07caefa1ec 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -260,7 +260,7 @@ LLVMTypeRef LLVMX86MMXType(void) { LLVMTypeRef LLVMFunctionType(LLVMTypeRef ReturnType, LLVMTypeRef *ParamTypes, unsigned ParamCount, LLVMBool IsVarArg) { - std::vector<const Type*> Tys; + std::vector<Type*> Tys; for (LLVMTypeRef *I = ParamTypes, *E = ParamTypes + ParamCount; I != E; ++I) Tys.push_back(unwrap(*I)); diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 972319e740..bde6a6d691 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -333,7 +333,7 @@ unsigned Function::getIntrinsicID() const { return 0; } -std::string Intrinsic::getName(ID id, const Type **Tys, unsigned numTys) { +std::string Intrinsic::getName(ID id, Type **Tys, unsigned numTys) { assert(id < num_intrinsics && "Invalid intrinsic ID!"); static const char * const Table[] = { "not_intrinsic", @@ -356,10 +356,10 @@ std::string Intrinsic::getName(ID id, const Type **Tys, unsigned numTys) { } const FunctionType *Intrinsic::getType(LLVMContext &Context, - ID id, const Type **Tys, + ID id, Type **Tys, unsigned numTys) { const Type *ResultTy = NULL; - std::vector<const Type*> ArgTys; + std::vector<Type*> ArgTys; bool IsVarArg = false; #define GET_INTRINSIC_GENERATOR @@ -384,7 +384,7 @@ bool Intrinsic::isOverloaded(ID id) { #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_ATTRIBUTES -Function *Intrinsic::getDeclaration(Module *M, ID id, const Type **Tys, +Function *Intrinsic::getDeclaration(Module *M, ID id, Type **Tys, unsigned numTys) { // There can never be multiple globals with the same name of different types, // because intrinsics must be a specific type. diff --git a/lib/VMCore/IRBuilder.cpp b/lib/VMCore/IRBuilder.cpp index f2d469a2d8..0908470216 100644 --- a/lib/VMCore/IRBuilder.cpp +++ b/lib/VMCore/IRBuilder.cpp @@ -65,7 +65,7 @@ CreateMemSet(Value *Ptr, Value *Val, Value *Size, unsigned Align, bool isVolatile, MDNode *TBAATag) { Ptr = getCastedInt8PtrValue(Ptr); Value *Ops[] = { Ptr, Val, Size, getInt32(Align), getInt1(isVolatile) }; - const Type *Tys[] = { Ptr->getType(), Size->getType() }; + Type *Tys[] = { Ptr->getType(), Size->getType() }; Module *M = BB->getParent()->getParent(); Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memset, Tys, 2); @@ -85,7 +85,7 @@ CreateMemCpy(Value *Dst, Value *Src, Value *Size, unsigned Align, Src = getCastedInt8PtrValue(Src); Value *Ops[] = { Dst, Src, Size, getInt32(Align), getInt1(isVolatile) }; - const Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() }; + Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() }; Module *M = BB->getParent()->getParent(); Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memcpy, Tys, 3); @@ -105,7 +105,7 @@ CreateMemMove(Value *Dst, Value *Src, Value *Size, unsigned Align, Src = getCastedInt8PtrValue(Src); Value *Ops[] = { Dst, Src, Size, getInt32(Align), getInt1(isVolatile) }; - const Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() }; + Type *Tys[] = { Dst->getType(), Src->getType(), Size->getType() }; Module *M = BB->getParent()->getParent(); Value *TheFn = Intrinsic::getDeclaration(M, Intrinsic::memmove, Tys, 3); diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp index 1ca70161d6..8a738cbac5 100644 --- a/lib/VMCore/Module.cpp +++ b/lib/VMCore/Module.cpp @@ -216,8 +216,8 @@ Constant *Module::getOrInsertFunction(StringRef Name, va_start(Args, RetTy); // Build the list of argument types... - std::vector<const Type*> ArgTys; - while (const Type *ArgTy = va_arg(Args, const Type*)) + std::vector<Type*> ArgTys; + while (Type *ArgTy = va_arg(Args, Type*)) ArgTys.push_back(ArgTy); va_end(Args); @@ -234,8 +234,8 @@ Constant *Module::getOrInsertFunction(StringRef Name, va_start(Args, RetTy); // Build the list of argument types... - std::vector<const Type*> ArgTys; - while (const Type *ArgTy = va_arg(Args, const Type*)) + std::vector<Type*> ArgTys; + while (Type *ArgTy = va_arg(Args, Type*)) ArgTys.push_back(ArgTy); va_end(Args); diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index ac8b76ff1e..40d232a619 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -325,13 +325,6 @@ FunctionType::FunctionType(const Type *Result, ArrayRef<Type*> Params, NumContainedTys = Params.size() + 1; // + 1 for result type } -// FIXME: Remove this version. -FunctionType *FunctionType::get(const Type *ReturnType, - ArrayRef<const Type*> Params, bool isVarArg) { - return get(ReturnType, ArrayRef<Type*>(const_cast<Type**>(Params.data()), - Params.size()), isVarArg); -} - // FunctionType::get - The factory function for the FunctionType class. FunctionType *FunctionType::get(const Type *ReturnType, ArrayRef<Type*> Params, bool isVarArg) { @@ -357,7 +350,7 @@ FunctionType *FunctionType::get(const Type *ReturnType, FunctionType *FunctionType::get(const Type *Result, bool isVarArg) { - return get(Result, ArrayRef<const Type *>(), isVarArg); + return get(Result, ArrayRef<Type *>(), isVarArg); } |