aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVladimir Medic <Vladimir.Medic@imgtec.com>2013-07-18 09:28:35 +0000
committerVladimir Medic <Vladimir.Medic@imgtec.com>2013-07-18 09:28:35 +0000
commit764f6f51257a0669acc58c8e5b4b802a29069302 (patch)
tree7026cb542a05eb50fb9df96f3f6ec2630178313d /lib
parentfe754512dcab6bb4bce4d3ea370c3202894e711b (diff)
downloadexternal_llvm-764f6f51257a0669acc58c8e5b4b802a29069302.zip
external_llvm-764f6f51257a0669acc58c8e5b4b802a29069302.tar.gz
external_llvm-764f6f51257a0669acc58c8e5b4b802a29069302.tar.bz2
This patch extends mips register parsing methods to allow indexed register parsing. The corresponding test cases are added to the patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/Mips/AsmParser/MipsAsmParser.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index de3c4fd..56a5dfd 100644
--- a/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -1268,6 +1268,18 @@ MipsAsmParser::parseRegs(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
// Set the proper register kind.
MipsOperand* op = static_cast<MipsOperand*>(Operands.back());
op->setRegKind(Kind);
+ if ((Kind == MipsOperand::Kind_CPURegs)
+ && (getLexer().is(AsmToken::LParen))) {
+ // Check if it is indexed addressing operand.
+ Operands.push_back(MipsOperand::CreateToken("(", getLexer().getLoc()));
+ Parser.Lex(); // Eat the parenthesis.
+ if (parseRegs(Operands,RegKind) != MatchOperand_Success)
+ return MatchOperand_NoMatch;
+ if (getLexer().isNot(AsmToken::RParen))
+ return MatchOperand_NoMatch;
+ Operands.push_back(MipsOperand::CreateToken(")", getLexer().getLoc()));
+ Parser.Lex();
+ }
return MatchOperand_Success;
}
return MatchOperand_NoMatch;