Add an assert to check atom ordinal.

No two atoms are allowed to have the same file and atom ordinals.
If there's such atoms, there's a bug in the reader.

llvm-svn: 227504
This commit is contained in:
Rui Ueyama 2015-01-29 22:39:43 +00:00
parent dafc2ae1ad
commit c10c4c9d9b
1 changed files with 1 additions and 0 deletions

View File

@ -42,6 +42,7 @@ static bool compareByPosition(const DefinedAtom *lhs, const DefinedAtom *rhs) {
const File *rhsFile = &rhs->file();
if (lhsFile->ordinal() != rhsFile->ordinal())
return lhsFile->ordinal() < rhsFile->ordinal();
assert(lhs->ordinal() != rhs->ordinal());
return lhs->ordinal() < rhs->ordinal();
}