}
if (exceptionChanged) {
- unsigned size = sizeof(QualType) * exceptionTypes.size();
- void *mem = Ctx.Allocate(size, llvm::alignOf<QualType>());
- memcpy(mem, exceptionTypes.data(), size);
- info.ExceptionSpec.Exceptions
- = llvm::makeArrayRef((QualType *)mem, exceptionTypes.size());
+ info.ExceptionSpec.Exceptions =
+ llvm::makeArrayRef(exceptionTypes).copy(Ctx);
}
}
}
if (exceptionChanged) {
- unsigned size = sizeof(QualType) * exceptionTypes.size();
- void *mem = ctx.Allocate(size, llvm::alignOf<QualType>());
- memcpy(mem, exceptionTypes.data(), size);
- info.ExceptionSpec.Exceptions
- = llvm::makeArrayRef((QualType *)mem, exceptionTypes.size());
+ info.ExceptionSpec.Exceptions =
+ llvm::makeArrayRef(exceptionTypes).copy(ctx);
}
}