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 | eeb64ae6e52ac2a7980884fe89c01508014af6a9 (patch) | |
tree | d642ebabea7be19546d56ed183345831207df879 /lib/VMCore/Type.cpp | |
parent | ce3a9f51ce1b11143e94394906299c7640cf31b7 (diff) | |
download | llvm-eeb64ae6e52ac2a7980884fe89c01508014af6a9.tar.gz llvm-eeb64ae6e52ac2a7980884fe89c01508014af6a9.tar.bz2 llvm-eeb64ae6e52ac2a7980884fe89c01508014af6a9.tar.xz |
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
Diffstat (limited to 'lib/VMCore/Type.cpp')
-rw-r--r-- | lib/VMCore/Type.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
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, 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); |