From: Simon Atanasyan Date: Thu, 19 May 2016 15:07:00 +0000 (+0000) Subject: [driver] Do not pass target triple to the MultilibSet include dirs callback X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d42e0e55e98f256f4eaefa8ea1d9c37c51732ee4;p=clang [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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270068 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Multilib.h b/include/clang/Driver/Multilib.h index 20bb80dca2..bc2c061df7 100644 --- a/include/clang/Driver/Multilib.h +++ b/include/clang/Driver/Multilib.h @@ -99,9 +99,9 @@ public: typedef multilib_list::iterator iterator; typedef multilib_list::const_iterator const_iterator; - typedef std::function( - StringRef InstallDir, StringRef Triple, const Multilib &M)> - IncludeDirsFunc; + typedef std::function(StringRef InstallDir, + const Multilib &M)> + IncludeDirsFunc; typedef llvm::function_ref FilterCallback; diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 3ec013c347..1a1c0f86cf 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -1924,7 +1924,7 @@ static bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, .FilterOut(".*sof/nan2008") .FilterOut(NonExistent) .setIncludeDirsCallback([](StringRef InstallDir, - StringRef TripleStr, const Multilib &M) { + const Multilib &M) { std::vector Dirs; Dirs.push_back((InstallDir + "/include").str()); std::string SysRootInc = @@ -1954,8 +1954,8 @@ static bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, 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 Dirs; Dirs.push_back( (InstallDir + "/../sysroot" + M.osSuffix() + "/usr/include").str()); @@ -2007,7 +2007,7 @@ static bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, .FilterOut("/micromips.*/64") .FilterOut(NonExistent) .setIncludeDirsCallback([](StringRef InstallDir, - StringRef TripleStr, const Multilib &M) { + const Multilib &M) { std::vector Dirs; Dirs.push_back((InstallDir + "/include").str()); std::string SysRootInc = @@ -2060,7 +2060,7 @@ static bool findMIPSMultilibs(const Driver &D, const llvm::Triple &TargetTriple, .Maybe(LittleEndian) .FilterOut(NonExistent) .setIncludeDirsCallback([](StringRef InstallDir, - StringRef TripleStr, const Multilib &M) { + const Multilib &M) { std::vector Dirs; Dirs.push_back((InstallDir + "/include").str()); Dirs.push_back( @@ -2540,8 +2540,7 @@ void MipsLLVMToolChain::AddClangSystemIncludeArgs( 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::AddClangCXXStdlibIncludeArgs( 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(const ArgList &DriverArgs, 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);