diff options
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.h | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp index 856d908b778..2d11a057046 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp +++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp @@ -70,6 +70,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) { .Case("_", MIToken::underscore) .Case("implicit", MIToken::kw_implicit) .Case("implicit-def", MIToken::kw_implicit_define) + .Case("dead", MIToken::kw_dead) .Default(MIToken::Identifier); } diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h index c66b2006e35..47c3c62b596 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.h +++ b/llvm/lib/CodeGen/MIRParser/MILexer.h @@ -39,6 +39,7 @@ struct MIToken { // Keywords kw_implicit, kw_implicit_define, + kw_dead, // Identifier tokens Identifier, @@ -74,7 +75,7 @@ public: } bool isRegisterFlag() const { - return Kind == kw_implicit || Kind == kw_implicit_define; + return Kind == kw_implicit || Kind == kw_implicit_define || Kind == kw_dead; } bool is(TokenKind K) const { return Kind == K; } diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index 463cc19d85e..8eefe19a408 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -305,6 +305,9 @@ bool MIParser::parseRegisterFlag(unsigned &Flags) { case MIToken::kw_implicit_define: Flags |= RegState::ImplicitDefine; break; + case MIToken::kw_dead: + Flags |= RegState::Dead; + break; // TODO: report an error when we specify the same flag more than once. // TODO: parse the other register flags. default: @@ -328,7 +331,8 @@ bool MIParser::parseRegisterOperand(MachineOperand &Dest, bool IsDef) { lex(); // TODO: Parse subregister. Dest = MachineOperand::CreateReg(Reg, Flags & RegState::Define, - Flags & RegState::Implicit); + Flags & RegState::Implicit, /*IsKill=*/false, + Flags & RegState::Dead); return false; } @@ -412,6 +416,7 @@ bool MIParser::parseMachineOperand(MachineOperand &Dest) { switch (Token.kind()) { case MIToken::kw_implicit: case MIToken::kw_implicit_define: + case MIToken::kw_dead: case MIToken::underscore: case MIToken::NamedRegister: return parseRegisterOperand(Dest); |

