[llvm] r258007 - [TableGen] Use a StringRef instead of creating a new std::string. It gets passed to a function that takes a StringRef anyway. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 17 00:47:03 PST 2016
Author: ctopper
Date: Sun Jan 17 02:47:02 2016
New Revision: 258007
URL: http://llvm.org/viewvc/llvm-project?rev=258007&view=rev
Log:
[TableGen] Use a StringRef instead of creating a new std::string. It gets passed to a function that takes a StringRef anyway. NFC
Modified:
llvm/trunk/utils/TableGen/AsmWriterInst.cpp
Modified: llvm/trunk/utils/TableGen/AsmWriterInst.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmWriterInst.cpp?rev=258007&r1=258006&r2=258007&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmWriterInst.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmWriterInst.cpp Sun Jan 17 02:47:02 2016
@@ -120,8 +120,7 @@ AsmWriterInst::AsmWriterInst(const CodeG
while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
++VarEnd;
- std::string VarName(AsmString.begin()+DollarPos+1,
- AsmString.begin()+VarEnd);
+ StringRef VarName(AsmString.data()+DollarPos+1, VarEnd-DollarPos-1);
// Modifier - Support ${foo:modifier} syntax, where "modifier" is passed
// into printOperand. Also support ${:feature}, which is passed into
@@ -143,7 +142,7 @@ AsmWriterInst::AsmWriterInst(const CodeG
PrintFatalError("Reached end of string before terminating curly brace in '"
+ CGI.TheDef->getName() + "'");
- unsigned ModifierStart = VarEnd;
+ std::string::size_type ModifierStart = VarEnd;
while (VarEnd < AsmString.size() && isIdentChar(AsmString[VarEnd]))
++VarEnd;
Modifier = std::string(AsmString.begin()+ModifierStart,
More information about the llvm-commits
mailing list