summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-07-31 23:13:23 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-07-31 23:13:23 +0000
commit59ed5919cd7c6cefbd5d77ee65704aafbe158dab (patch)
tree52d33c8c6b0077f1cb82183d0167ec744b70d3c2 /llvm/lib/CodeGen/MIRParser
parent1e156011d138d475f507d3dfc4c3df7fef496a1f (diff)
downloadbcm5719-llvm-59ed5919cd7c6cefbd5d77ee65704aafbe158dab.tar.gz
bcm5719-llvm-59ed5919cd7c6cefbd5d77ee65704aafbe158dab.zip
MIR Parser: Report an error when a jump table entry is redefined.
llvm-svn: 243798
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIRParser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
index cc277eea9f4..0679ec02c98 100644
--- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp
@@ -582,8 +582,11 @@ bool MIRParserImpl::initializeJumpTableInfo(
Blocks.push_back(MBB);
}
unsigned Index = JTI->createJumpTableIndex(Blocks);
- // TODO: Report an error when the same jump table slot ID is redefined.
- PFS.JumpTableSlots.insert(std::make_pair(Entry.ID, Index));
+ if (!PFS.JumpTableSlots.insert(std::make_pair(Entry.ID.Value, Index))
+ .second)
+ return error(Entry.ID.SourceRange.Start,
+ Twine("redefinition of jump table entry '%jump-table.") +
+ Twine(Entry.ID.Value) + "'");
}
return false;
}
OpenPOWER on IntegriCloud