diff options
| author | Jay Foad <jay.foad@gmail.com> | 2011-07-11 09:56:20 +0000 |
|---|---|---|
| committer | Jay Foad <jay.foad@gmail.com> | 2011-07-11 09:56:20 +0000 |
| commit | 7c57be3e2b6f3001cdb1e78b921f9e7ccc84f32c (patch) | |
| tree | 78c4de58c0ef5727e68c34792646f069b2fde448 /llvm/lib/VMCore | |
| parent | dd8fc04e9bf9b5288bb73bcd0d2a1e079b5a0750 (diff) | |
| download | bcm5719-llvm-7c57be3e2b6f3001cdb1e78b921f9e7ccc84f32c.tar.gz bcm5719-llvm-7c57be3e2b6f3001cdb1e78b921f9e7ccc84f32c.zip | |
De-constify Types in StructType::get() and TargetData::getIntPtrType().
llvm-svn: 134893
Diffstat (limited to 'llvm/lib/VMCore')
| -rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Core.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Type.cpp | 13 |
3 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index 57498b48592..1529c4ad481 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -619,7 +619,7 @@ Constant *ConstantArray::get(LLVMContext &Context, StringRef Str, StructType *ConstantStruct::getTypeForElements(LLVMContext &Context, ArrayRef<Constant*> V, bool Packed) { - SmallVector<const Type*, 16> EltTypes; + SmallVector<Type*, 16> EltTypes; for (unsigned i = 0, e = V.size(); i != e; ++i) EltTypes.push_back(V[i]->getType()); diff --git a/llvm/lib/VMCore/Core.cpp b/llvm/lib/VMCore/Core.cpp index 07caefa1ec4..15d27233f22 100644 --- a/llvm/lib/VMCore/Core.cpp +++ b/llvm/lib/VMCore/Core.cpp @@ -290,7 +290,7 @@ void LLVMGetParamTypes(LLVMTypeRef FunctionTy, LLVMTypeRef *Dest) { LLVMTypeRef LLVMStructTypeInContext(LLVMContextRef C, LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed) { - std::vector<const Type*> Tys; + std::vector<Type*> Tys; for (LLVMTypeRef *I = ElementTypes, *E = ElementTypes + ElementCount; I != E; ++I) Tys.push_back(unwrap(*I)); diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp index 40d232a619f..10467a8d900 100644 --- a/llvm/lib/VMCore/Type.cpp +++ b/llvm/lib/VMCore/Type.cpp @@ -458,22 +458,15 @@ void StructType::setName(StringRef Name) { //===----------------------------------------------------------------------===// // StructType Helper functions. -// FIXME: Remove this version. -StructType *StructType::get(LLVMContext &Context, ArrayRef<const Type*>Elements, - bool isPacked) { - return get(Context, ArrayRef<Type*>(const_cast<Type**>(Elements.data()), - Elements.size()), isPacked); -} - StructType *StructType::get(LLVMContext &Context, bool isPacked) { - return get(Context, llvm::ArrayRef<const Type*>(), isPacked); + return get(Context, llvm::ArrayRef<Type*>(), isPacked); } -StructType *StructType::get(const Type *type, ...) { +StructType *StructType::get(Type *type, ...) { assert(type != 0 && "Cannot create a struct type with no elements with this"); LLVMContext &Ctx = type->getContext(); va_list ap; - SmallVector<const llvm::Type*, 8> StructFields; + SmallVector<llvm::Type*, 8> StructFields; va_start(ap, type); while (type) { StructFields.push_back(type); |

