DebugInfo: Emit info for casted decls in template args

Summary:
Previously the backend wouldn't get to see the underlying GlobalValue
that corresponds to the template argument because it would be hidden by
a cast at the IR level.  Instead strip the pointer casts off of the
value until we see the underlying GlobalValue.

Reviewers: dblaikie, echristo, majnemer

Reviewed By: majnemer

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1508

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189200 91177308-0d34-0410-b5e6-96231b3b80d8
CodeGen: Unify two implementations of canDevirtualizeMemberFunctionCall.

They were mostly copy&paste of each other, move it to CodeGenFunction. Of course
the two implementations have diverged over time; the one in CGExprCXX seems to
be the more modern one so I picked that one and moved it to CGClass which feels
like a better home for it. No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189203 91177308-0d34-0410-b5e6-96231b3b80d8