Currently we can access destination argument of any memory intrinsic (MemCpyInst, MemSetInst, ...) through the functions of their common base class - MemIntrinsicBase.
But I think these functions must not be declared such early in the class hierarchy (which now for MemSetInst is
IntrinsicInst <-- MemIntrinsicBase<MemIntrinsic> <-- MemIntrinsic <-- MemSetBase<MemWriteIntrinsic> <-- MemSetInst)
We might want to add some new memory intrinsics in the future that do not have dest argument (i.e. sth like memcmp which would have LHS and RHS instead of src and dest).
So this patch introduces new classes in this hierarchy: MemWriteIntrinsicBase in which we define functions related to dest argument; AtomicMemWriteIntrinsic and
MemWriteIntrinsic which derive from MWIB and define classof functions; AnyMemWriteIntrinsic. If now we were to add a new intrinsic which doesn't have dest argument we would derive from MemIntrinsic (or AtomicMemIntrinsic) and wouldn't have that dest argument related logic.
Having introduced these classes, this patch rewrites all uses of MemIntrinsicBase's dest functions so that MemWriteIntrinsicBase is used.