CodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode
authorAlexander Potapenko <glider@google.com>
Tue, 26 Feb 2019 10:46:21 +0000 (10:46 +0000)
committerAlexander Potapenko <glider@google.com>
Tue, 26 Feb 2019 10:46:21 +0000 (10:46 +0000)
commit4f7bc0eee7e6099b1abd57dac3c83529944ab23c
tree136f2e89c0697c93302121948ac81e42e70dd734
parent53350d041154350bcacbca5a7692d910e0a741de
CodeGen: Explicitly initialize structure padding in the -ftrivial-auto-var-init mode

When generating initializers for local structures in the
-ftrivial-auto-var-init mode, explicitly wipe the padding bytes with
either 0x00 or 0xAA.

This will allow us to automatically handle the padding when splitting
the initialization stores (see https://reviews.llvm.org/D57898).

Reviewed at https://reviews.llvm.org/D58188

llvm-svn: 354861
clang/lib/CodeGen/CGDecl.cpp
clang/test/CodeGenCXX/auto-var-init.cpp