Allow the type of a global to be different from the type of its  associated declaration. This is a prerequisite to handling general union initializations; for example, an array of unions involving  pointers has to be turned into a struct because the elements can have  incompatible types.
Allow the type of a global to be different from the type of its 
associated declaration. This is a prerequisite to handling
general union initializations; for example, an array of unions involving 
pointers has to be turned into a struct because the elements can have 
incompatible types.

I refactored the code a bit to make it more readable; now, the logic for 
definitions is all in EmitGlobalVarInit.

The second parameter for GetAddrOfGlobalVar is now dead; I'll remove it 
separately.

By itself, this patch should not cause any visible changes.



git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@51783 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang