Add a flag to debug automatic variable initialization
authorJian Cai <caij2003@gmail.com>
Mon, 8 Jun 2020 18:53:23 +0000 (11:53 -0700)
committerJian Cai <jiancai@google.com>
Mon, 8 Jun 2020 19:30:56 +0000 (12:30 -0700)
commit4db2b70248686b8ac0667237768008762a66bb06
treec2a20384afe417e131921197512f7a89b78b4aad
parentf25e3c2d0e8553e6640ca5e0d1933c0e9455bd71
Add a flag to debug automatic variable initialization

Summary:
Add -ftrivial-auto-var-init-stop-after= to limit the number of times
stack variables are initialized when -ftrivial-auto-var-init= is used to
initialize stack variables to zero or a pattern. This flag can be used
to bisect uninitialized uses of a stack variable exposed by automatic
variable initialization, such as http://crrev.com/c/2020401.

Reviewers: jfb, vitalybuka, kcc, glider, rsmith, rjmccall, pcc, eugenis, vlad.tsyrklevich

Reviewed By: jfb

Subscribers: phosek, hubert.reinterpretcast, srhines, MaskRay, george.burgess.iv, dexonsmith, inglorion, gbiv, llozano, manojgupta, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77168
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/Options.td
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/CodeGen/CGDecl.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGenCXX/auto-var-init-stop-after.cpp [new file with mode: 0644]
clang/test/Driver/clang_f_opts.c