]> granicus.if.org Git - clang/commit
Change CodeGenModule GlobalDeclMap to directly reference globals
authorDaniel Dunbar <daniel@zuster.org>
Wed, 30 Jul 2008 16:32:24 +0000 (16:32 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 30 Jul 2008 16:32:24 +0000 (16:32 +0000)
commit9986eabd4423d867262c358ca62f94a60ac58412
tree9b718aa5c13a4179e5b9eb20398704c6239076dc
parentae8a25591dc7e5fd5d6dde5c44cada268be98973
Change CodeGenModule GlobalDeclMap to directly reference globals
instead of mapping the decl to a bitcast of the global to the correct
type.

 - GetAddrOf{Function,GlobalVar} introduce the bitcast on every use now.

 - This solves a problem where a dangling pointer could be introduced
   by the RAUW done when replacing a forward or tentative
   definition. See testcase for more details.

 - Fixes <rdar://problem/6108358>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54211 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGen/2008-07-30-redef-of-bitcasted-decl.c [new file with mode: 0644]