DWARF type hashing: Handle multiple (including recursive) references to the same type

This uses a map, keeping the type DIE numbering separate from the DIEs
themselves - alternatively we could do things the way GCC does if we
want to add an integer to the DIE type to record the numbering there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193105 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the build in DIE.cpp with MSVC 2010

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193107 91177308-0d34-0410-b5e6-96231b3b80d8
Use more type helper functions

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