From 3abf05739f032fd03ed30d665aa5ecb7cb2c44f9 Mon Sep 17 00:00:00 2001 From: Francis Visoiu Mistrih Date: Tue, 13 Mar 2018 19:53:16 +0000 Subject: [MIR] Allow frame-setup and frame-destroy on the same instruction Nothing prevents us from having both frame-setup and frame-destroy on the same instruction. When merging: * frame-setup OPCODE1 * frame-destroy OPCODE2 into * frame-setup frame-destroy OPCODE3 we want to be able to print and parse both flags. llvm-svn: 327442 --- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/MIRParser') diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index f3d46afb0b0..18cc6db3196 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -923,11 +923,13 @@ bool MIParser::verifyImplicitOperands(ArrayRef Operands, } bool MIParser::parseInstruction(unsigned &OpCode, unsigned &Flags) { - if (Token.is(MIToken::kw_frame_setup)) { - Flags |= MachineInstr::FrameSetup; - lex(); - } else if (Token.is(MIToken::kw_frame_destroy)) { - Flags |= MachineInstr::FrameDestroy; + // Allow both: + // * frame-setup frame-destroy OPCODE + // * frame-destroy frame-setup OPCODE + while (Token.is(MIToken::kw_frame_setup) || + Token.is(MIToken::kw_frame_destroy)) { + Flags |= Token.is(MIToken::kw_frame_setup) ? MachineInstr::FrameSetup + : MachineInstr::FrameDestroy; lex(); } if (Token.isNot(MIToken::Identifier)) -- cgit v1.2.3