MIR Parser: Report an error when a jump table entry is redefined.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243798 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alex Lorenz
2015-07-31 23:13:23 +00:00
parent faa33cdc3c
commit c198b23a4d
3 changed files with 88 additions and 3 deletions

View File

@@ -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;
}