This is an archive of the discontinued LLVM Phabricator instance.

Fix NAME.1 comdat name for replaced GlobalVariable
ClosedPublic

Authored by yaron.keren on Jul 29 2015, 8:17 AM.

Details

Reviewers
rnk
Summary

In case of an existing GlobalVariable, the comdat is created using the name of the new GV (usually NAME.1) instead of the correct NAME of the old GV. Moving comdat creation after GV replacement solves this. Patch + testcase.

Diff Detail

Repository
rL LLVM

Event Timeline

yaron.keren retitled this revision from to Fix NAME.1 comdat name for replaced GlobalVariable.
yaron.keren updated this object.
yaron.keren set the repository for this revision to rL LLVM.
yaron.keren added subscribers: hans, cfe-commits, rnk, rafael.
rnk accepted this revision.Jul 29 2015, 8:24 AM
rnk added a reviewer: rnk.

lgtm with slightly tighter test case.

tools/clang/test/CodeGenCXX/vtable-key-function-win-comdat.cpp
18

Can you also CHECK that the vtable definition has the right name, linkage, and uses this comdat?

This revision is now accepted and ready to land.Jul 29 2015, 8:24 AM
yaron.keren closed this revision.Jul 29 2015, 9:04 AM

r243525 with expanded testcase.