From eeb64ae6e52ac2a7980884fe89c01508014af6a9 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Mon, 11 Jul 2011 09:56:20 +0000 Subject: De-constify Types in StructType::get() and TargetData::getIntPtrType(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Type.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/VMCore/Type.cpp') diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 40d232a619..10467a8d90 100644 --- a/lib/VMCore/Type.cpp +++ b/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, ArrayRefElements, - bool isPacked) { - return get(Context, ArrayRef(const_cast(Elements.data()), - Elements.size()), isPacked); -} - StructType *StructType::get(LLVMContext &Context, bool isPacked) { - return get(Context, llvm::ArrayRef(), isPacked); + return get(Context, llvm::ArrayRef(), 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 StructFields; + SmallVector StructFields; va_start(ap, type); while (type) { StructFields.push_back(type); -- cgit v1.2.3