Only destroy static locals if they have non-trivial destructors.
authorRichard Smith <richard@metafoo.co.uk>
Fri, 10 Jan 2020 23:16:15 +0000 (15:16 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Fri, 10 Jan 2020 23:18:36 +0000 (15:18 -0800)
commit7a38468e34eeeb59e80b176b97213d205d8d9b41
treefb8054b8dbe96661bca0d22c0b9df58e540e7295
parentd3ba1e026dbc44e9097ce6ea1c92d065f1fe33e8
Only destroy static locals if they have non-trivial destructors.

This fixes a regression introduced in
2b4fa5348ee157b6b1a1af44d0137ca8c7a71573 that caused us to emit
shutdown-time destruction for variables with ARC ownership, using
C++-specific functions that don't exist in C implementations.
clang/lib/CodeGen/CGDecl.cpp
clang/test/CodeGenObjC/initialize-function-static.m [new file with mode: 0644]