assert(isValidReturnType(Result) && "invalid return type for function");
setSubclassData(IsVarArgs);
- SubTys[0] = const_cast<Type*>(Result);
+ SubTys[0] = Result;
for (unsigned i = 0, e = Params.size(); i != e; ++i) {
assert(isValidArgumentType(Params[i]) &&
NumElements = NumEl;
}
-ArrayType *ArrayType::get(Type *elementType, uint64_t NumElements) {
- Type *ElementType = const_cast<Type*>(elementType);
+ArrayType *ArrayType::get(Type *ElementType, uint64_t NumElements) {
assert(isValidElementType(ElementType) && "Invalid type for array element!");
-
+
LLVMContextImpl *pImpl = ElementType->getContext().pImpl;
ArrayType *&Entry =
pImpl->ArrayTypes[std::make_pair(ElementType, NumElements)];
NumElements = NumEl;
}
-VectorType *VectorType::get(Type *elementType, unsigned NumElements) {
- Type *ElementType = const_cast<Type*>(elementType);
+VectorType *VectorType::get(Type *ElementType, unsigned NumElements) {
assert(NumElements > 0 && "#Elements of a VectorType must be greater than 0");
assert(isValidElementType(ElementType) && "Element type of a VectorType must "
"be an integer, floating point, or "