From f382538d471e38a9b98f016c4caebd24c8d60b62 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 1 Jun 2017 20:58:36 +0000 Subject: Vendor import of llvm trunk r304460: https://llvm.org/svn/llvm-project/llvm/trunk@304460 --- utils/TableGen/FixedLenDecoderEmitter.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'utils/TableGen/FixedLenDecoderEmitter.cpp') diff --git a/utils/TableGen/FixedLenDecoderEmitter.cpp b/utils/TableGen/FixedLenDecoderEmitter.cpp index e1aaeccb08d0..75fd73082b9a 100644 --- a/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -1145,16 +1145,15 @@ bool FilterChooser::emitPredicateMatch(raw_ostream &o, unsigned &Indentation, if (!Pred->getValue("AssemblerMatcherPredicate")) continue; - std::string P = Pred->getValueAsString("AssemblerCondString"); + StringRef P = Pred->getValueAsString("AssemblerCondString"); - if (!P.length()) + if (P.empty()) continue; if (!IsFirstEmission) o << " && "; - StringRef SR(P); - std::pair pairs = SR.split(','); + std::pair pairs = P.split(','); while (!pairs.second.empty()) { emitSinglePredicateMatch(o, pairs.first, Emitter->PredicateNamespace); o << " && "; @@ -1174,9 +1173,9 @@ bool FilterChooser::doesOpcodeNeedPredicate(unsigned Opc) const { if (!Pred->getValue("AssemblerMatcherPredicate")) continue; - std::string P = Pred->getValueAsString("AssemblerCondString"); + StringRef P = Pred->getValueAsString("AssemblerCondString"); - if (!P.length()) + if (P.empty()) continue; return true; @@ -1744,7 +1743,7 @@ static bool populateInstruction(CodeGenTarget &Target, // If the instruction has specified a custom decoding hook, use that instead // of trying to auto-generate the decoder. - std::string InstDecoder = Def.getValueAsString("DecoderMethod"); + StringRef InstDecoder = Def.getValueAsString("DecoderMethod"); if (InstDecoder != "") { bool HasCompleteInstDecoder = Def.getValueAsBit("hasCompleteDecoder"); InsnOperands.push_back(OperandInfo(InstDecoder, HasCompleteInstDecoder)); @@ -2261,7 +2260,7 @@ void FixedLenDecoderEmitter::run(raw_ostream &o) { Def->getValueAsBit("isCodeGenOnly")) continue; - std::string DecoderNamespace = Def->getValueAsString("DecoderNamespace"); + StringRef DecoderNamespace = Def->getValueAsString("DecoderNamespace"); if (Size) { if (populateInstruction(Target, *Inst, i, Operands)) { -- cgit v1.3