[cfe-commits] r86967 - /cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Daniel Dunbar daniel at zuster.org
Wed Nov 11 23:28:30 PST 2009


Author: ddunbar
Date: Thu Nov 12 01:28:29 2009
New Revision: 86967

URL: http://llvm.org/viewvc/llvm-project?rev=86967&view=rev
Log:
Avoid comparing string literals.

Modified:
    cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=86967&r1=86966&r2=86967&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Thu Nov 12 01:28:29 2009
@@ -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;





More information about the cfe-commits mailing list