mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-22 15:39:28 +00:00
MC/ARM: Split mnemonic on '.' characters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110793 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fa315de8f4
commit
5747b13af8
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user