diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MILexer.h | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIParser.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/MIRPrinter.cpp | 2 |
4 files changed, 13 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp index 2d11a057046..37e71edea4e 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp +++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp @@ -71,6 +71,7 @@ static MIToken::TokenKind getIdentifierKind(StringRef Identifier) { .Case("implicit", MIToken::kw_implicit) .Case("implicit-def", MIToken::kw_implicit_define) .Case("dead", MIToken::kw_dead) + .Case("killed", MIToken::kw_killed) .Default(MIToken::Identifier); } diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h index 47c3c62b596..610a7b95b40 100644 --- a/llvm/lib/CodeGen/MIRParser/MILexer.h +++ b/llvm/lib/CodeGen/MIRParser/MILexer.h @@ -40,6 +40,7 @@ struct MIToken { kw_implicit, kw_implicit_define, kw_dead, + kw_killed, // Identifier tokens Identifier, @@ -75,7 +76,8 @@ public: } bool isRegisterFlag() const { - return Kind == kw_implicit || Kind == kw_implicit_define || Kind == kw_dead; + return Kind == kw_implicit || Kind == kw_implicit_define || + Kind == kw_dead || Kind == kw_killed; } 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 8eefe19a408..01e7d324a75 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -308,6 +308,9 @@ bool MIParser::parseRegisterFlag(unsigned &Flags) { case MIToken::kw_dead: Flags |= RegState::Dead; break; + case MIToken::kw_killed: + Flags |= RegState::Kill; + break; // TODO: report an error when we specify the same flag more than once. // TODO: parse the other register flags. default: @@ -330,9 +333,9 @@ bool MIParser::parseRegisterOperand(MachineOperand &Dest, bool IsDef) { return true; lex(); // TODO: Parse subregister. - Dest = MachineOperand::CreateReg(Reg, Flags & RegState::Define, - Flags & RegState::Implicit, /*IsKill=*/false, - Flags & RegState::Dead); + Dest = MachineOperand::CreateReg( + Reg, Flags & RegState::Define, Flags & RegState::Implicit, + Flags & RegState::Kill, Flags & RegState::Dead); return false; } @@ -417,6 +420,7 @@ bool MIParser::parseMachineOperand(MachineOperand &Dest) { case MIToken::kw_implicit: case MIToken::kw_implicit_define: case MIToken::kw_dead: + case MIToken::kw_killed: case MIToken::underscore: case MIToken::NamedRegister: return parseRegisterOperand(Dest); diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp index a1f20f57251..e3b515b54cc 100644 --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -218,6 +218,8 @@ void MIPrinter::print(const MachineOperand &Op, const TargetRegisterInfo *TRI) { OS << (Op.isDef() ? "implicit-def " : "implicit "); if (Op.isDead()) OS << "dead "; + if (Op.isKill()) + OS << "killed "; printReg(Op.getReg(), OS, TRI); // TODO: Print sub register. break; |

