[IR] Implement pairs of non-const and const methods using the const version instead of the non-const version. NFCI

This removes a const_cast of the this pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298831 91177308-0d34-0410-b5e6-96231b3b80d8
10 files changed