[llvm] r274538 - Revert r274536: [mips][ias] Don't break apart and reconstruct StringRef's for k_Token. NFC.
Daniel Sanders via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 5 03:44:24 PDT 2016
Author: dsanders
Date: Tue Jul 5 05:44:24 2016
New Revision: 274538
URL: http://llvm.org/viewvc/llvm-project?rev=274538&view=rev
Log:
Revert r274536: [mips][ias] Don't break apart and reconstruct StringRef's for k_Token. NFC.
It turns out that MSVC requires this.
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=274538&r1=274537&r2=274538&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Tue Jul 5 05:44:24 2016
@@ -599,7 +599,8 @@ private:
MipsAsmParser &AsmParser;
struct Token {
- StringRef Str;
+ const char *Data;
+ unsigned Length;
};
struct PhysRegOp {
@@ -1165,7 +1166,7 @@ public:
StringRef getToken() const {
assert(Kind == k_Token && "Invalid access!");
- return Tok.Str;
+ return StringRef(Tok.Data, Tok.Length);
}
bool isRegPair() const {
return Kind == k_RegPair && RegIdx.Index <= 30;
@@ -1219,7 +1220,8 @@ public:
static std::unique_ptr<MipsOperand> CreateToken(StringRef Str, SMLoc S,
MipsAsmParser &Parser) {
auto Op = make_unique<MipsOperand>(k_Token, Parser);
- Op->Tok.Str = Str;
+ Op->Tok.Data = Str.data();
+ Op->Tok.Length = Str.size();
Op->StartLoc = S;
Op->EndLoc = S;
return Op;
@@ -1435,7 +1437,7 @@ public:
OS << "RegIdx<" << RegIdx.Index << ":" << RegIdx.Kind << ">";
break;
case k_Token:
- OS << Tok.Str;
+ OS << Tok.Data;
break;
case k_RegList:
OS << "RegList< ";
More information about the llvm-commits
mailing list