summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2018-05-29 09:51:33 +0000
committerSimon Atanasyan <simon@atanasyan.com>2018-05-29 09:51:33 +0000
commitb2d61fa3d888cc474b608b23c9eab7aad09f50e4 (patch)
tree437e36d1c756557cde3b9dbcbbe8e5c99c97d338 /llvm/lib
parentd408ec4cfa0d4e0d21e8c3a885d1b910cc5ee3fd (diff)
downloadbcm5719-llvm-b2d61fa3d888cc474b608b23c9eab7aad09f50e4.tar.gz
bcm5719-llvm-b2d61fa3d888cc474b608b23c9eab7aad09f50e4.zip
[mips] Cleanup the code to reduce diff with the upcoming patches. NFC
llvm-svn: 333404
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp20
1 files changed, 10 insertions, 10 deletions
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<const MCSymbolRefExpr *>(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;
}
OpenPOWER on IntegriCloud