]> granicus.if.org Git - clang/commitdiff
Since getDriver().getInstalledDir() returns a const char *, don't try to
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 1 Mar 2011 22:50:47 +0000 (22:50 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 1 Mar 2011 22:50:47 +0000 (22:50 +0000)
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!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126791 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index 4a9be0ef76b18660edad786d31cb87bea9702505..bb83492158628268ce4663498ffce97b0244a308 100644 (file)
@@ -940,7 +940,7 @@ Darwin_Generic_GCC::ComputeEffectiveClangTriple(const ArgList &Args) const {
 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 @@ AuroraUX::AuroraUX(const HostInfo &Host, const llvm::Triple& Triple)
   : 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 @@ DragonFly::DragonFly(const HostInfo &Host, const llvm::Triple& Triple)
 
   // 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");