[XRay] Use AddCXXStdlibLibArgs. NFCI.

This function already does the very same thing.

llvm-svn: 297271
This commit is contained in:
Jonas Hahnfeld 2017-03-08 12:06:44 +00:00
parent 0f4db38c20
commit 34120d6743
1 changed files with 3 additions and 4 deletions

View File

@ -347,10 +347,9 @@ static void linkXRayRuntimeDeps(const ToolChain &TC, const ArgList &Args,
CmdArgs.push_back("-lrt"); CmdArgs.push_back("-lrt");
CmdArgs.push_back("-lm"); CmdArgs.push_back("-lm");
CmdArgs.push_back("-latomic"); CmdArgs.push_back("-latomic");
if (TC.GetCXXStdlibType(Args) == ToolChain::CST_Libcxx)
CmdArgs.push_back("-lc++"); TC.AddCXXStdlibLibArgs(Args, CmdArgs);
else
CmdArgs.push_back("-lstdc++");
if (TC.getTriple().getOS() != llvm::Triple::FreeBSD) if (TC.getTriple().getOS() != llvm::Triple::FreeBSD)
CmdArgs.push_back("-ldl"); CmdArgs.push_back("-ldl");
} }