diff options
author | Amy Huang <akhuang@google.com> | 2020-08-13 15:48:55 -0700 |
---|---|---|
committer | Amy Huang <akhuang@google.com> | 2020-08-13 15:48:55 -0700 |
commit | ae6523cd62a44642390f4f9d9ba9ce17d5bbbc58 (patch) | |
tree | 2ca7852cd9700083f2ac2dbae0a683f7b2997d01 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | ab9fc8bae805c785066779e76e7846aabad5609e (diff) | |
download | llvm-ae6523cd62a44642390f4f9d9ba9ce17d5bbbc58.zip llvm-ae6523cd62a44642390f4f9d9ba9ce17d5bbbc58.tar.gz llvm-ae6523cd62a44642390f4f9d9ba9ce17d5bbbc58.tar.bz2 |
[DebugInfo] Add -fuse-ctor-homing cc1 flag so we can turn on constructor homing only if limited debug info is already on.
This adds a cc1 flag to enable constructor homing but doesn't turn on debug
info if it wasn't enabled already (which is what using
-debug-info-kind=constructor does). This will be used for testing, and won't
be needed anymore once ctor homing is used as default / merged into =limited.
Bug to enable ctor homing: https://bugs.llvm.org/show_bug.cgi?id=46537
Differential Revision: https://reviews.llvm.org/D85799
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 17c43ec..86504ed 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -775,6 +775,12 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, else Opts.setDebugInfo(static_cast<codegenoptions::DebugInfoKind>(Val)); } + // If -fuse-ctor-homing is set and limited debug info is already on, then use + // constructor homing. + if (Arg *A = Args.getLastArg(OPT_fuse_ctor_homing)) + if (Opts.getDebugInfo() == codegenoptions::LimitedDebugInfo) + Opts.setDebugInfo(codegenoptions::DebugInfoConstructor); + if (Arg *A = Args.getLastArg(OPT_debugger_tuning_EQ)) { unsigned Val = llvm::StringSwitch<unsigned>(A->getValue()) .Case("gdb", unsigned(llvm::DebuggerKind::GDB)) |