[cfe-commits] r135166 - in /cfe/trunk/lib: Basic/Targets.cpp Serialization/ASTWriter.cpp

Chris Lattner sabre at nondot.org
Thu Jul 14 11:24:21 PDT 2011


Author: lattner
Date: Thu Jul 14 13:24:21 2011
New Revision: 135166

URL: http://llvm.org/viewvc/llvm-project?rev=135166&view=rev
Log:
StringMap::first() is about to start returning a StringRef, adapt.


Modified:
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/lib/Serialization/ASTWriter.cpp

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=135166&r1=135165&r2=135166&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Jul 14 13:24:21 2011
@@ -3055,7 +3055,8 @@
   Opts.Features.clear();
   for (llvm::StringMap<bool>::const_iterator it = Features.begin(),
          ie = Features.end(); it != ie; ++it)
-    Opts.Features.push_back(std::string(it->second ? "+" : "-") + it->first());
+    Opts.Features.push_back(std::string(it->second ? "+" : "-") +
+                            llvm::StringRef(it->first()).str());
   Target->HandleTargetFeatures(Opts.Features);
 
   return Target.take();

Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=135166&r1=135165&r2=135166&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Thu Jul 14 13:24:21 2011
@@ -1174,8 +1174,8 @@
   for (MemorizeStatCalls::iterator Stat = StatCalls.begin(),
                                 StatEnd = StatCalls.end();
        Stat != StatEnd; ++Stat, ++NumStatEntries) {
-    const char *Filename = Stat->first();
-    Generator.insert(Filename, Stat->second);
+    llvm::StringRef Filename = Stat->first();
+    Generator.insert(Filename.data(), Stat->second);
   }
 
   // Create the on-disk hash table in a buffer.





More information about the cfe-commits mailing list