Avoid comparing string literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86967 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 38a0896..c9dd3c6 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -303,10 +303,10 @@
void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple) {
// FIXME: temporary hack: hard-coded paths.
- if (C_INCLUDE_DIRS != "") {
+ llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS);
+ if (CIncludeDirs != "") {
std::vector<std::string> dirs;
- std::string str(C_INCLUDE_DIRS);
- llvm::SplitString(str, dirs, ":");
+ llvm::SplitString(CIncludeDirs, dirs, ":");
for (std::vector<std::string>::iterator i = dirs.begin(); i != dirs.end(); ++i)
AddPath(*i, System, false, false, false);
return;