Refactor checkUnsafeAssigns() to avoid code duplication with while loop.

This is just a minor bit of refactoring, but it is nice cleanup for
the subsequent patch that adds warning support for assigning literals
to weak variables.

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