]> granicus.if.org Git - clang/commit
Allow the type of a global to be different from the type of its
authorEli Friedman <eli.friedman@gmail.com>
Fri, 30 May 2008 19:50:47 +0000 (19:50 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 30 May 2008 19:50:47 +0000 (19:50 +0000)
commit77ba708819285931932ecd33691a672bb59d221a
tree3071021801ef2a662787c6cc565e48875c517d02
parentc1cc6dccd42b91a2ebb397415940da91dbf36103
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: https://llvm.org/svn/llvm-project/cfe/trunk@51783 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenModule.cpp