ObjectiveC: fix a seg fault when deserialing redeclaration of ObjCMethodDecl.

The deserialization of redeclartion can cause seg fault since getCanonicalDecl
of the redeclaration returns the lookup result on the ObjCContainerDecl,
which can be null if FindExternalVisibleDeclsByName is not done updating
the lookup results.

The fix is to return the redeclaration itself as the canonical decl. Note that
the handling for redeclaration of ObjCMethodDecl is not in line with other
redeclarables.

rdar://28488466


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