aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorJian Cai <caij2003@gmail.com>2020-06-08 11:53:23 -0700
committerJian Cai <jiancai@google.com>2020-06-08 12:30:56 -0700
commit4db2b70248686b8ac0667237768008762a66bb06 (patch)
treec2a20384afe417e131921197512f7a89b78b4aad /clang/lib/CodeGen/CodeGenModule.h
parentf25e3c2d0e8553e6640ca5e0d1933c0e9455bd71 (diff)
downloadllvm-4db2b70248686b8ac0667237768008762a66bb06.zip
llvm-4db2b70248686b8ac0667237768008762a66bb06.tar.gz
llvm-4db2b70248686b8ac0667237768008762a66bb06.tar.bz2
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 864488c..17d42c5 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -302,6 +302,7 @@ private:
const HeaderSearchOptions &HeaderSearchOpts; // Only used for debug info.
const PreprocessorOptions &PreprocessorOpts; // Only used for debug info.
const CodeGenOptions &CodeGenOpts;
+ unsigned NumAutoVarInit = 0;
llvm::Module &TheModule;
DiagnosticsEngine &Diags;
const TargetInfo &Target;
@@ -1393,6 +1394,7 @@ public:
CharUnits getNaturalPointeeTypeAlignment(QualType T,
LValueBaseInfo *BaseInfo = nullptr,
TBAAAccessInfo *TBAAInfo = nullptr);
+ bool stopAutoInit();
private:
llvm::Constant *GetOrCreateLLVMFunction(