Emit invariant.group.barrier when using union field
authorPiotr Padlewski <piotr.padlewski@gmail.com>
Thu, 1 Jun 2017 18:39:34 +0000 (18:39 +0000)
committerPiotr Padlewski <piotr.padlewski@gmail.com>
Thu, 1 Jun 2017 18:39:34 +0000 (18:39 +0000)
commit42ee2c4bdf7c217c5d1849ebdf2194fab7bec450
treef85a229d41c645f503e87fbb0099bdb992d36ebd
parent7fac438f2983a1bef6a1982d93ccb63a7dce5275
Emit invariant.group.barrier when using union field

Summary:
We need to emit barrier if the union field
is CXXRecordDecl because it might have vptrs. The testcode
was wrongly devirtualized. It also proves that having different
groups for different dynamic types is not sufficient.

Reviewers: rjmccall, rsmith, mehdi_amini

Subscribers: amharc, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304448 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
test/CodeGenCXX/strict-vtable-pointers.cpp