MipsAsmParser &AsmParser;
struct Token {
- StringRef Str;
+ const char *Data;
+ unsigned Length;
};
struct PhysRegOp {
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;
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;
OS << "RegIdx<" << RegIdx.Index << ":" << RegIdx.Kind << ">";
break;
case k_Token:
- OS << Tok.Str;
+ OS << Tok.Data;
break;
case k_RegList:
OS << "RegList< ";