[GlobalOpt] Collect initializer when building GlobalPart.
authorFlorian Hahn <flo@fhahn.com>
Sun, 19 Mar 2023 20:47:59 +0000 (20:47 +0000)
committerFlorian Hahn <flo@fhahn.com>
Sun, 19 Mar 2023 20:47:59 +0000 (20:47 +0000)
commit84870c4abbacfb97ca025c9219b724f381611380
treee43a6725078daae7b607367878d736a22a8e519d
parentef860cf150f0d7e0f635026c55182bc1f65ac8f9
[GlobalOpt] Collect initializer when building GlobalPart.

Update the code to collect the initializer when collecting the types for
a global, as suggested by @nikic in D144476.

This replaces code which bailed out if *any* part doesn't have an
initializer with a continue to just skip parts which don't have an
initializer.

Depends on D145489.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D145490
llvm/lib/Transforms/IPO/GlobalOpt.cpp