]> granicus.if.org Git - llvm/commitdiff
TableGen: avoid string copy.
authorTim Northover <tnorthover@apple.com>
Tue, 5 Jul 2016 22:51:30 +0000 (22:51 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 5 Jul 2016 22:51:30 +0000 (22:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274584 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/SearchableTableEmitter.cpp

index 1b0e67f835fe7c8a8d1c09a3f5c5690367473201..8c1b8804d1741feb890da1c6b4f02252259bdf3c 100644 (file)
@@ -230,7 +230,7 @@ void SearchableTableEmitter::emitLookupDeclaration(StringRef Name,
 
 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.