From b2d61fa3d888cc474b608b23c9eab7aad09f50e4 Mon Sep 17 00:00:00 2001 From: Simon Atanasyan Date: Tue, 29 May 2018 09:51:33 +0000 Subject: [mips] Cleanup the code to reduce diff with the upcoming patches. NFC llvm-svn: 333404 --- llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp') diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 5b242c3705b..09a02a67681 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -5971,13 +5971,12 @@ MipsAsmParser::parseMemOperand(OperandVector &Operands) { bool MipsAsmParser::searchSymbolAlias(OperandVector &Operands) { MCAsmParser &Parser = getParser(); MCSymbol *Sym = getContext().lookupSymbol(Parser.getTok().getIdentifier()); - if (Sym) { - SMLoc S = Parser.getTok().getLoc(); - const MCExpr *Expr; - if (Sym->isVariable()) - Expr = Sym->getVariableValue(); - else - return false; + if (!Sym) + return false; + + SMLoc S = Parser.getTok().getLoc(); + if (Sym->isVariable()) { + const MCExpr *Expr = Sym->getVariableValue(); if (Expr->getKind() == MCExpr::SymbolRef) { const MCSymbolRefExpr *Ref = static_cast(Expr); StringRef DefSymbol = Ref->getSymbol().getName(); @@ -5987,12 +5986,13 @@ bool MipsAsmParser::searchSymbolAlias(OperandVector &Operands) { if (ResTy == MatchOperand_Success) { Parser.Lex(); return true; - } else if (ResTy == MatchOperand_ParseFail) + } + if (ResTy == MatchOperand_ParseFail) llvm_unreachable("Should never ParseFail"); - return false; } } } + return false; } @@ -6085,7 +6085,7 @@ MipsAsmParser::matchAnyRegisterWithoutDollar(OperandVector &Operands, SMLoc S) { return MatchOperand_Success; } - LLVM_DEBUG(dbgs() << Parser.getTok().getKind() << "\n"); + LLVM_DEBUG(dbgs() << Token.getKind() << "\n"); return MatchOperand_NoMatch; } -- cgit v1.2.3