<div dir="auto">Did you see my comments about raw_ostream?</div><div><br><div class="gmail_quote"><div>On Fri, Sep 22, 2017 at 6:34 AM Simon Pilgrim via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL313983: [TableGen] Return StringRef from ValueTypeByHwMode::getMVTName (authored by RKSimon).<br>
<br>
Changed prior to commit:<br>
<a href="https://reviews.llvm.org/D38174?vs=116333&id=116343#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D38174?vs=116333&id=116343#toc</a><br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D38174" rel="noreferrer" target="_blank">https://reviews.llvm.org/D38174</a><br>
<br>
Files:<br>
llvm/trunk/utils/TableGen/InfoByHwMode.cpp<br>
llvm/trunk/utils/TableGen/InfoByHwMode.h<br>
<br>
<br>
Index: llvm/trunk/utils/TableGen/InfoByHwMode.cpp<br>
===================================================================<br>
--- llvm/trunk/utils/TableGen/InfoByHwMode.cpp<br>
+++ llvm/trunk/utils/TableGen/InfoByHwMode.cpp<br>
@@ -70,10 +70,9 @@<br>
return Map.insert(std::make_pair(Mode, Type)).first->second;<br>
}<br>
<br>
-std::string ValueTypeByHwMode::getMVTName(MVT T) {<br>
- std::string N = llvm::getEnumName(T.SimpleTy);<br>
- if (N.substr(0,5) == "MVT::")<br>
- N = N.substr(5);<br>
+StringRef ValueTypeByHwMode::getMVTName(MVT T) {<br>
+ StringRef N = llvm::getEnumName(T.SimpleTy);<br>
+ N.consume_front("MVT::");<br>
return N;<br>
}<br>
<br>
@@ -91,7 +90,7 @@<br>
for (unsigned i = 0, e = Pairs.size(); i != e; ++i) {<br>
const PairType *P = Pairs[i];<br>
str << '(' << getModeName(P->first)<br>
- << ':' << getMVTName(P->second) << ')';<br>
+ << ':' << getMVTName(P->second).str() << ')';<br>
if (i != e-1)<br>
str << ',';<br>
}<br>
Index: llvm/trunk/utils/TableGen/InfoByHwMode.h<br>
===================================================================<br>
--- llvm/trunk/utils/TableGen/InfoByHwMode.h<br>
+++ llvm/trunk/utils/TableGen/InfoByHwMode.h<br>
@@ -129,7 +129,7 @@<br>
MVT getType(unsigned Mode) const { return get(Mode); }<br>
MVT &getOrCreateTypeForMode(unsigned Mode, MVT Type);<br>
<br>
- static std::string getMVTName(MVT T);<br>
+ static StringRef getMVTName(MVT T);<br>
std::string getAsString() const;<br>
void dump() const;<br>
};<br>
<br>
<br>
</blockquote></div></div>