diff options
author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-13 19:53:16 +0000 |
---|---|---|
committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2018-03-13 19:53:16 +0000 |
commit | 3abf05739f032fd03ed30d665aa5ecb7cb2c44f9 (patch) | |
tree | 8af919a4eb7a0a2abecb3a1cf92ab7675ff2adc3 /llvm/lib/CodeGen/MIRParser/MIParser.cpp | |
parent | 27c1afbb0b4e08f045126d04f1b341418a873321 (diff) | |
download | llvm-3abf05739f032fd03ed30d665aa5ecb7cb2c44f9.zip llvm-3abf05739f032fd03ed30d665aa5ecb7cb2c44f9.tar.gz llvm-3abf05739f032fd03ed30d665aa5ecb7cb2c44f9.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index f3d46af..18cc6db 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -923,11 +923,13 @@ bool MIParser::verifyImplicitOperands(ArrayRef<ParsedMachineOperand> 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)) |