Since getDriver().getInstalledDir() returns a const char *, don't try to
compare it with getDriver().Dir.c_str(), since that is a pointer
comparison, not a "are these strings equal" comparison.
Instead, just compare with getDriver().Dir directly, so both sides will
get promoted to std::string, and the regular std::string comparison
operator applies.
Patch by Dimitry Andric!
llvm-svn: 126791
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 4a9be0e..bb83492 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -940,7 +940,7 @@
Generic_GCC::Generic_GCC(const HostInfo &Host, const llvm::Triple& Triple)
: ToolChain(Host, Triple) {
getProgramPaths().push_back(getDriver().getInstalledDir());
- if (getDriver().getInstalledDir() != getDriver().Dir.c_str())
+ if (getDriver().getInstalledDir() != getDriver().Dir)
getProgramPaths().push_back(getDriver().Dir);
}
@@ -1235,7 +1235,7 @@
: Generic_GCC(Host, Triple) {
getProgramPaths().push_back(getDriver().getInstalledDir());
- if (getDriver().getInstalledDir() != getDriver().Dir.c_str())
+ if (getDriver().getInstalledDir() != getDriver().Dir)
getProgramPaths().push_back(getDriver().Dir);
getFilePaths().push_back(getDriver().Dir + "/../lib");
@@ -1565,7 +1565,7 @@
// Path mangling to find libexec
getProgramPaths().push_back(getDriver().getInstalledDir());
- if (getDriver().getInstalledDir() != getDriver().Dir.c_str())
+ if (getDriver().getInstalledDir() != getDriver().Dir)
getProgramPaths().push_back(getDriver().Dir);
getFilePaths().push_back(getDriver().Dir + "/../lib");