summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 0b5c59dee0c..b3fd16f1588 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -962,6 +962,8 @@ bool MIParser::parseRegisterOperand(MachineOperand &Dest,
if (Token.is(MIToken::colon)) {
if (parseSubRegisterIndex(SubReg))
return true;
+ if (!TargetRegisterInfo::isVirtualRegister(Reg))
+ return error("subregister index expects a virtual register");
}
if ((Flags & RegState::Define) == 0) {
if (consumeIfPresent(MIToken::lparen)) {
OpenPOWER on IntegriCloud