[CodeGen] Add additional mangling for struct members of non trivial structs
authorShoaib Meenai <smeenai@fb.com>
Thu, 28 Mar 2019 17:01:20 +0000 (17:01 +0000)
committerShoaib Meenai <smeenai@fb.com>
Thu, 28 Mar 2019 17:01:20 +0000 (17:01 +0000)
commit155e26f0f43c92131d624fe5e0db4b3cb010cf96
tree44e5134b3bcb0b4e61381973fd520b6a4f9b09d4
parent1af05df3de60802c523661385b04229106a0c2c3
[CodeGen] Add additional mangling for struct members of non trivial structs

In https://bugs.llvm.org/show_bug.cgi?id=41206 we observe bad codegen
when embedding a non-trivial C struct within a C struct. This is due to
the fact that name mangling for non-trivial structs marks the two
structs as identical. This diff contains a fix for this issue.

Patch by Dan Zimmerman <daniel.zimmerman@me.com>.

Differential Revision: https://reviews.llvm.org/D59873

llvm-svn: 357184
clang/lib/CodeGen/CGNonTrivialStruct.cpp
clang/test/CodeGenObjC/nontrivial-c-struct-within-struct-name.m [new file with mode: 0644]
clang/test/CodeGenObjC/strong-in-c-struct.m