[CodeGen] Always update map entry after adding initializer
authorNikita Popov <npopov@redhat.com>
Thu, 16 Dec 2021 15:15:38 +0000 (16:15 +0100)
committerNikita Popov <npopov@redhat.com>
Thu, 16 Dec 2021 15:29:35 +0000 (16:29 +0100)
commit828552201420720ff52c9a27ea4e8f3697f1abc1
treedbfa48edbca6e6cc8d66c137feaede030e577fd6
parent2b4e6052b3bfff7177d81a747e9f48b44da9eb1c
[CodeGen] Always update map entry after adding initializer

With opaque pointers the pointer cast may be a no-op, such that
var and castedAddr are the same. However, we still need to update
the map entry as the underlying global changed. We could explicitly
check whether the global was replaced, but we may as well just
always update the entry.
clang/lib/CodeGen/CGDecl.cpp