[llvm] r274584 - TableGen: avoid string copy.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 5 15:51:30 PDT 2016


Author: tnorthover
Date: Tue Jul  5 17:51:30 2016
New Revision: 274584

URL: http://llvm.org/viewvc/llvm-project?rev=274584&view=rev
Log:
TableGen: avoid string copy.

Modified:
    llvm/trunk/utils/TableGen/SearchableTableEmitter.cpp

Modified: llvm/trunk/utils/TableGen/SearchableTableEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/SearchableTableEmitter.cpp?rev=274584&r1=274583&r2=274584&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/SearchableTableEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/SearchableTableEmitter.cpp Tue Jul  5 17:51:30 2016
@@ -230,7 +230,7 @@ void SearchableTableEmitter::emitLookupD
 
 void SearchableTableEmitter::emitMapping(Record *InstanceClass,
                                          raw_ostream &OS) {
-  std::string TableName = InstanceClass->getName();
+  const std::string &TableName = InstanceClass->getName();
   std::vector<Record *> Items = Records.getAllDerivedDefinitions(TableName);
 
   // Gather all the records we're going to need for this particular mapping.




More information about the llvm-commits mailing list