From 517bbc64dbe493644eff8d55fd9566435e930520 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 22 Jun 2022 23:26:23 +0000 Subject: DebugInfo: Fully integrate ctor type homing into 'limited' debug info Simplify debug info back to just "limited" or "full" by rolling the ctor type homing fully into the "limited" debug info. Also fix a bug I found along the way that was causing ctor type homing to kick in even when something could be vtable homed (where vtable homing is stronger/more effective than ctor homing) - fixing at the same time as it keeps the tests (that were testing only "limited non ctor" homing and now test ctor homing) passing. --- clang/lib/Frontend/CompilerInvocation.cpp | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c0eed3a..0cf5978 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1360,9 +1360,6 @@ void CompilerInvocation::GenerateCodeGenArgs( case codegenoptions::DebugDirectivesOnly: DebugInfoVal = "line-directives-only"; break; - case codegenoptions::DebugInfoConstructor: - DebugInfoVal = "constructor"; - break; case codegenoptions::LimitedDebugInfo: DebugInfoVal = "limited"; break; @@ -1637,7 +1634,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, llvm::StringSwitch(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) @@ -1649,18 +1645,6 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setDebugInfo(static_cast(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( -- cgit v1.1