diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2c696b5..a8f25fa 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1369,9 +1369,6 @@ void CompilerInvocation::GenerateCodeGenArgs( if (DebugInfoVal) GenerateArg(Args, OPT_debug_info_kind_EQ, *DebugInfoVal, SA); - if (Opts.DebugInfo == codegenoptions::DebugInfoConstructor) - GenerateArg(Args, OPT_fuse_ctor_homing, SA); - for (const auto &Prefix : Opts.DebugPrefixMap) GenerateArg(Args, OPT_fdebug_prefix_map_EQ, Prefix.first + "=" + Prefix.second, SA); @@ -1627,10 +1624,16 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, } // If -fuse-ctor-homing is set and limited debug info is already on, then use - // constructor homing. - if (Args.getLastArg(OPT_fuse_ctor_homing)) - if (Opts.getDebugInfo() == codegenoptions::LimitedDebugInfo) + // 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('='); |