[globalopt] Don't emit DWARF fragments for members
authorDavid Spickett <david.spickett@linaro.org>
Thu, 23 Apr 2020 13:40:57 +0000 (14:40 +0100)
committerDavid Spickett <david.spickett@linaro.org>
Thu, 30 Apr 2020 10:36:55 +0000 (11:36 +0100)
commit3929429347d398773577b79f7fdb780d4f7ed887
treecd1bec2337bf4cf8d241730e94e3ff0eacfac4e4
parent09f6b9792bcdaa057d23caa62eb38265a3f1a668
[globalopt] Don't emit DWARF fragments for members
of a struct that cover the whole struct

This can happen when the rest of the
members of are zero length. Following
the same pattern applied to the SROA
pass in:
d7f6f1636d53c3e2faf55cdf20fbb44a1a149df1

Fixes: https://bugs.llvm.org/show_bug.cgi?id=45335

Differential Revision: https://reviews.llvm.org/D78720
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/test/DebugInfo/Generic/global-sra-struct-zero-length.ll [new file with mode: 0644]