diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-08-11 06:37:16 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-08-11 06:37:16 +0000 |
commit | 0e55d907262e8d6e4c8ba7b2412f1fd0294ec386 (patch) | |
tree | 99eb57f66f5f2697f7a1ef79ba9e939960a628c3 /lib/Target/ARM | |
parent | 43ba789b65eb806be0e03c0bb5b44062a374694c (diff) | |
download | external_llvm-0e55d907262e8d6e4c8ba7b2412f1fd0294ec386.zip external_llvm-0e55d907262e8d6e4c8ba7b2412f1fd0294ec386.tar.gz external_llvm-0e55d907262e8d6e4c8ba7b2412f1fd0294ec386.tar.bz2 |
MC/ARM: Split mnemonic on '.' characters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110793 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM')
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index fec3c82..b87d458 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -651,12 +651,25 @@ bool ARMAsmParser::ParseOperand(OwningPtr<ARMOperand> &Op) { bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc, SmallVectorImpl<MCParsedAsmOperand*> &Operands) { OwningPtr<ARMOperand> Op; - ARMOperand::CreateToken(Op, Name, NameLoc); - + + // Create the leading tokens for the mnemonic, split by '.' characters. + size_t Start = 0, Next = Name.find('.'); + StringRef Head = Name.slice(Start, Next); + + ARMOperand::CreateToken(Op, Head, NameLoc); Operands.push_back(Op.take()); - if (getLexer().isNot(AsmToken::EndOfStatement)) { + while (Next != StringRef::npos) { + Start = Next; + Next = Name.find('.', Start + 1); + Head = Name.slice(Start, Next); + ARMOperand::CreateToken(Op, Head, NameLoc); + Operands.push_back(Op.take()); + } + + // Read the remaining operands. + if (getLexer().isNot(AsmToken::EndOfStatement)) { // Read the first operand. OwningPtr<ARMOperand> Op; if (ParseOperand(Op)) return true; |