diff options
-rw-r--r-- | include/clang/Driver/ToolChain.h | 6 | ||||
-rw-r--r-- | lib/Driver/Tools.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/clang/Driver/ToolChain.h b/include/clang/Driver/ToolChain.h index cc8d438db3..501e833202 100644 --- a/include/clang/Driver/ToolChain.h +++ b/include/clang/Driver/ToolChain.h @@ -53,9 +53,9 @@ public: const Driver &getDriver() const; const llvm::Triple &getTriple() const { return Triple; } - std::string getArchName() const { return Triple.getArchName(); } - std::string getPlatform() const { return Triple.getVendorName(); } - std::string getOS() const { return Triple.getOSName(); } + llvm::StringRef getArchName() const { return Triple.getArchName(); } + llvm::StringRef getPlatform() const { return Triple.getVendorName(); } + llvm::StringRef getOS() const { return Triple.getOSName(); } std::string getTripleString() const { return Triple.getTriple(); diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 2e7435fa32..2354bd494e 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -512,7 +512,7 @@ void Clang::AddX86TargetArgs(const ArgList &Args, // Select the default CPU if none was given (or detection failed). if (!CPUName) { // FIXME: Need target hooks. - if (memcmp(getToolChain().getOS().c_str(), "darwin", 6) == 0) { + if (getToolChain().getOS().startswith("darwin")) { if (getToolChain().getArchName() == "x86_64") CPUName = "core2"; else if (getToolChain().getArchName() == "i386") |