aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2022-06-24 16:47:57 +0000
committerDavid Blaikie <dblaikie@gmail.com>2022-06-24 17:07:47 +0000
commit4821508d4db75a535d02b8938f81fac6de66cc26 (patch)
tree78aafc523b16f0dd3300c8ab15bf8618c1ae823b /clang/lib/Frontend/CompilerInvocation.cpp
parente0d069598bc8c147c8b6625253c1f32f26baaab1 (diff)
downloadllvm-4821508d4db75a535d02b8938f81fac6de66cc26.zip
llvm-4821508d4db75a535d02b8938f81fac6de66cc26.tar.gz
llvm-4821508d4db75a535d02b8938f81fac6de66cc26.tar.bz2
Revert "DebugInfo: Fully integrate ctor type homing into 'limited' debug info"
Reverting to simplify some Google-internal rollout issues. Will recommit in a week or two. This reverts commit 517bbc64dbe493644eff8d55fd9566435e930520.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 0cf5978..c0eed3a 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1360,6 +1360,9 @@ void CompilerInvocation::GenerateCodeGenArgs(
case codegenoptions::DebugDirectivesOnly:
DebugInfoVal = "line-directives-only";
break;
+ case codegenoptions::DebugInfoConstructor:
+ DebugInfoVal = "constructor";
+ break;
case codegenoptions::LimitedDebugInfo:
DebugInfoVal = "limited";
break;
@@ -1634,6 +1637,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
llvm::StringSwitch<unsigned>(A->getValue())
.Case("line-tables-only", codegenoptions::DebugLineTablesOnly)
.Case("line-directives-only", codegenoptions::DebugDirectivesOnly)
+ .Case("constructor", codegenoptions::DebugInfoConstructor)
.Case("limited", codegenoptions::LimitedDebugInfo)
.Case("standalone", codegenoptions::FullDebugInfo)
.Case("unused-types", codegenoptions::UnusedTypeInfo)
@@ -1645,6 +1649,18 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
Opts.setDebugInfo(static_cast<codegenoptions::DebugInfoKind>(Val));
}
+ // If -fuse-ctor-homing is set and limited debug info is already on, then use
+ // constructor homing, and vice versa for -fno-use-ctor-homing.
+ if (const Arg *A =
+ Args.getLastArg(OPT_fuse_ctor_homing, OPT_fno_use_ctor_homing)) {
+ if (A->getOption().matches(OPT_fuse_ctor_homing) &&
+ Opts.getDebugInfo() == codegenoptions::LimitedDebugInfo)
+ Opts.setDebugInfo(codegenoptions::DebugInfoConstructor);
+ if (A->getOption().matches(OPT_fno_use_ctor_homing) &&
+ Opts.getDebugInfo() == codegenoptions::DebugInfoConstructor)
+ Opts.setDebugInfo(codegenoptions::LimitedDebugInfo);
+ }
+
for (const auto &Arg : Args.getAllArgValues(OPT_fdebug_prefix_map_EQ)) {
auto Split = StringRef(Arg).split('=');
Opts.DebugPrefixMap.insert(