]> granicus.if.org Git - clang/commit
Rewrite ConstStructBuilder with a mechanism that can cope with splitting and updating...
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 17 Jun 2019 21:08:30 +0000 (21:08 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 17 Jun 2019 21:08:30 +0000 (21:08 +0000)
commit0547f03627934cc7cee480b766135a6a85bce31b
tree1f81e6b4281dfb2254c2a7d88b4533e467c00ca6
parentf211949b2d72d64f832e1e5f5706890f4ee89767
Rewrite ConstStructBuilder with a mechanism that can cope with splitting and updating constants.

Summary:
This adds a ConstantBuilder class that deals with incrementally building
an aggregate constant, including support for overwriting
previously-emitted parts of the aggregate with new values.

This fixes a bunch of cases where we used to be unable to reduce a
DesignatedInitUpdateExpr down to an IR constant, and also lays some
groundwork for emission of class constants with [[no_unique_address]]
members.

Reviewers: rjmccall

Subscribers: cfe-commits

Tags: #clang

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@363620 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprConstant.cpp
test/CodeGenCXX/designated-init.cpp [new file with mode: 0644]