<div dir="ltr">Just copying some of the information given through Phab ( <a href="https://reviews.llvm.org/rL347035">https://reviews.llvm.org/rL347035</a> ) - this patch was reverted in r347676. Would be great to get that fixed/recommitted!</div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 16, 2018 at 12:01 AM George Rimar via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: grimar<br>
Date: Thu Nov 15 23:59:24 2018<br>
New Revision: 347035<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=347035&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=347035&view=rev</a><br>
Log:<br>
[clang] - Simplify tools::SplitDebugName.<br>
<br>
This should be NFC change.<br>
<br>
SplitDebugName recently started to accept the `Output` that<br>
can be used to simplify the logic a bit, also it<br>
seems that code in SplitDebugName that uses<br>
OPT_fdebug_compilation_dir is simply dead.<br>
<br>
Differential revision: <a href="https://reviews.llvm.org/D54576" rel="noreferrer" target="_blank">https://reviews.llvm.org/D54576</a><br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/ToolChains/Clang.cpp<br>
cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp<br>
cfe/trunk/lib/Driver/ToolChains/CommonArgs.h<br>
cfe/trunk/lib/Driver/ToolChains/Gnu.cpp<br>
cfe/trunk/lib/Driver/ToolChains/MinGW.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=347035&r1=347034&r2=347035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=347035&r1=347034&r2=347035&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Thu Nov 15 23:59:24 2018<br>
@@ -3936,7 +3936,7 @@ void Clang::ConstructJob(Compilation &C,<br>
const char *SplitDWARFOut;<br>
if (SplitDWARF) {<br>
CmdArgs.push_back("-split-dwarf-file");<br>
- SplitDWARFOut = SplitDebugName(Args, Input, Output);<br>
+ SplitDWARFOut = SplitDebugName(Args, Output);<br>
CmdArgs.push_back(SplitDWARFOut);<br>
}<br>
<br>
@@ -5902,7 +5902,7 @@ void ClangAs::ConstructJob(Compilation &<br>
if ((getDebugFissionKind(D, Args, A) == DwarfFissionKind::Split) &&<br>
(T.isOSLinux() || T.isOSFuchsia())) {<br>
CmdArgs.push_back("-split-dwarf-file");<br>
- CmdArgs.push_back(SplitDebugName(Args, Input, Output));<br>
+ CmdArgs.push_back(SplitDebugName(Args, Output));<br>
}<br>
<br>
assert(Input.isFilename() && "Invalid input.");<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=347035&r1=347034&r2=347035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=347035&r1=347034&r2=347035&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Thu Nov 15 23:59:24 2018<br>
@@ -808,26 +808,15 @@ bool tools::areOptimizationsEnabled(cons<br>
return false;<br>
}<br>
<br>
-const char *tools::SplitDebugName(const ArgList &Args, const InputInfo &Input,<br>
+const char *tools::SplitDebugName(const ArgList &Args,<br>
const InputInfo &Output) {<br>
if (Arg *A = Args.getLastArg(options::OPT_gsplit_dwarf_EQ))<br>
if (StringRef(A->getValue()) == "single")<br>
return Args.MakeArgString(Output.getFilename());<br>
<br>
- Arg *FinalOutput = Args.getLastArg(options::OPT_o);<br>
- if (FinalOutput && Args.hasArg(options::OPT_c)) {<br>
- SmallString<128> T(FinalOutput->getValue());<br>
- llvm::sys::path::replace_extension(T, "dwo");<br>
- return Args.MakeArgString(T);<br>
- } else {<br>
- // Use the compilation dir.<br>
- SmallString<128> T(<br>
- Args.getLastArgValue(options::OPT_fdebug_compilation_dir));<br>
- SmallString<128> F(llvm::sys::path::stem(Input.getBaseInput()));<br>
- llvm::sys::path::replace_extension(F, "dwo");<br>
- T += F;<br>
- return Args.MakeArgString(F);<br>
- }<br>
+ SmallString<128> T(Output.getFilename());<br>
+ llvm::sys::path::replace_extension(T, "dwo");<br>
+ return Args.MakeArgString(T);<br>
}<br>
<br>
void tools::SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T,<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.h?rev=347035&r1=347034&r2=347035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.h?rev=347035&r1=347034&r2=347035&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.h (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.h Thu Nov 15 23:59:24 2018<br>
@@ -63,7 +63,7 @@ void AddHIPLinkerScript(const ToolChain<br>
const Tool &T);<br>
<br>
const char *SplitDebugName(const llvm::opt::ArgList &Args,<br>
- const InputInfo &Input, const InputInfo &Output);<br>
+ const InputInfo &Output);<br>
<br>
void SplitDebugInfo(const ToolChain &TC, Compilation &C, const Tool &T,<br>
const JobAction &JA, const llvm::opt::ArgList &Args,<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/Gnu.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=347035&r1=347034&r2=347035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Gnu.cpp?rev=347035&r1=347034&r2=347035&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/Gnu.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/Gnu.cpp Thu Nov 15 23:59:24 2018<br>
@@ -817,7 +817,7 @@ void tools::gnutools::Assembler::Constru<br>
if (Args.hasArg(options::OPT_gsplit_dwarf) &&<br>
getToolChain().getTriple().isOSLinux())<br>
SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,<br>
- SplitDebugName(Args, Inputs[0], Output));<br>
+ SplitDebugName(Args, Output));<br>
}<br>
<br>
namespace {<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/MinGW.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MinGW.cpp?rev=347035&r1=347034&r2=347035&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/MinGW.cpp?rev=347035&r1=347034&r2=347035&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/MinGW.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/MinGW.cpp Thu Nov 15 23:59:24 2018<br>
@@ -54,7 +54,7 @@ void tools::MinGW::Assembler::ConstructJ<br>
<br>
if (Args.hasArg(options::OPT_gsplit_dwarf))<br>
SplitDebugInfo(getToolChain(), C, *this, JA, Args, Output,<br>
- SplitDebugName(Args, Inputs[0], Output));<br>
+ SplitDebugName(Args, Output));<br>
}<br>
<br>
void tools::MinGW::Linker::AddLibGCC(const ArgList &Args,<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>