From: Jonas Hahnfeld Date: Wed, 8 Mar 2017 12:06:44 +0000 (+0000) Subject: [XRay] Use AddCXXStdlibLibArgs. NFCI. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e67276e923bb759eb94f623c2529a6ca266e942;p=clang [XRay] Use AddCXXStdlibLibArgs. NFCI. This function already does the very same thing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297271 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp index 6425850cd8..fe3c0191bb 100644 --- a/lib/Driver/ToolChains/Gnu.cpp +++ b/lib/Driver/ToolChains/Gnu.cpp @@ -347,10 +347,9 @@ static void linkXRayRuntimeDeps(const ToolChain &TC, const ArgList &Args, CmdArgs.push_back("-lrt"); CmdArgs.push_back("-lm"); CmdArgs.push_back("-latomic"); - if (TC.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx) - CmdArgs.push_back("-lc++"); - else - CmdArgs.push_back("-lstdc++"); + + TC.AddCXXStdlibLibArgs(Args, CmdArgs); + if (TC.getTriple().getOS() != llvm::Triple::FreeBSD) CmdArgs.push_back("-ldl"); }