r270068 - [driver] Do not pass target triple to the MultilibSet include dirs callback
Simon Atanasyan via cfe-commits
cfe-commits at lists.llvm.org
Thu May 19 08:07:01 PDT 2016
Author: atanasyan
Date: Thu May 19 10:07:00 2016
New Revision: 270068
URL: http://llvm.org/viewvc/llvm-project?rev=270068&view=rev
Log:
[driver] Do not pass target triple to the MultilibSet include dirs callback
No one callback uses target triple so we can escape passing the unused
argument.
Modified:
cfe/trunk/include/clang/Driver/Multilib.h
cfe/trunk/lib/Driver/ToolChains.cpp
Modified: cfe/trunk/include/clang/Driver/Multilib.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Multilib.h?rev=270068&r1=270067&r2=270068&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Multilib.h (original)
+++ cfe/trunk/include/clang/Driver/Multilib.h Thu May 19 10:07:00 2016
@@ -99,9 +99,9 @@ public:
typedef multilib_list::iterator iterator;
typedef multilib_list::const_iterator const_iterator;
- typedef std::function<std::vector<std::string>(
- StringRef InstallDir, StringRef Triple, const Multilib &M)>
- IncludeDirsFunc;
+ typedef std::function<std::vector<std::string>(StringRef InstallDir,
+ const Multilib &M)>
+ IncludeDirsFunc;
typedef llvm::function_ref<bool(const Multilib &)> FilterCallback;
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=270068&r1=270067&r2=270068&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Thu May 19 10:07:00 2016
@@ -1924,7 +1924,7 @@ static bool findMIPSMultilibs(const Driv
.FilterOut(".*sof/nan2008")
.FilterOut(NonExistent)
.setIncludeDirsCallback([](StringRef InstallDir,
- StringRef TripleStr, const Multilib &M) {
+ const Multilib &M) {
std::vector<std::string> Dirs;
Dirs.push_back((InstallDir + "/include").str());
std::string SysRootInc =
@@ -1954,8 +1954,8 @@ static bool findMIPSMultilibs(const Driv
MuslMipsMultilibs = MultilibSet().Either(MArchMipsR2, MArchMipselR2);
// Specify the callback that computes the include directories.
- MuslMipsMultilibs.setIncludeDirsCallback([](
- StringRef InstallDir, StringRef TripleStr, const Multilib &M) {
+ MuslMipsMultilibs.setIncludeDirsCallback([](StringRef InstallDir,
+ const Multilib &M) {
std::vector<std::string> Dirs;
Dirs.push_back(
(InstallDir + "/../sysroot" + M.osSuffix() + "/usr/include").str());
@@ -2007,7 +2007,7 @@ static bool findMIPSMultilibs(const Driv
.FilterOut("/micromips.*/64")
.FilterOut(NonExistent)
.setIncludeDirsCallback([](StringRef InstallDir,
- StringRef TripleStr, const Multilib &M) {
+ const Multilib &M) {
std::vector<std::string> Dirs;
Dirs.push_back((InstallDir + "/include").str());
std::string SysRootInc =
@@ -2060,7 +2060,7 @@ static bool findMIPSMultilibs(const Driv
.Maybe(LittleEndian)
.FilterOut(NonExistent)
.setIncludeDirsCallback([](StringRef InstallDir,
- StringRef TripleStr, const Multilib &M) {
+ const Multilib &M) {
std::vector<std::string> Dirs;
Dirs.push_back((InstallDir + "/include").str());
Dirs.push_back(
@@ -2540,8 +2540,7 @@ void MipsLLVMToolChain::AddClangSystemIn
const auto &Callback = Multilibs.includeDirsCallback();
if (Callback) {
- const auto IncludePaths =
- Callback(D.getInstalledDir(), getTripleString(), SelectedMultilib);
+ const auto IncludePaths = Callback(D.getInstalledDir(), SelectedMultilib);
for (const auto &Path : IncludePaths)
addExternCSystemIncludeIfExists(DriverArgs, CC1Args, Path);
}
@@ -2588,8 +2587,8 @@ void MipsLLVMToolChain::AddClangCXXStdli
const auto &Callback = Multilibs.includeDirsCallback();
if (Callback) {
- const auto IncludePaths = Callback(getDriver().getInstalledDir(),
- getTripleString(), SelectedMultilib);
+ const auto IncludePaths =
+ Callback(getDriver().getInstalledDir(), SelectedMultilib);
for (const auto &Path : IncludePaths) {
if (llvm::sys::fs::exists(Path + "/c++/v1")) {
addSystemInclude(DriverArgs, CC1Args, Path + "/c++/v1");
@@ -3971,7 +3970,6 @@ void Linux::AddClangSystemIncludeArgs(co
const auto &Callback = Multilibs.includeDirsCallback();
if (Callback) {
const auto IncludePaths = Callback(GCCInstallation.getInstallPath(),
- GCCInstallation.getTriple().str(),
GCCInstallation.getMultilib());
for (const auto &Path : IncludePaths)
addExternCSystemIncludeIfExists(DriverArgs, CC1Args, Path);
More information about the cfe-commits
mailing list