[lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.

llvm-svn: 181752
This commit is contained in:
Rui Ueyama 2013-05-14 01:51:56 +00:00
parent 1f24e6a6a2
commit 5ec6d1a9cd
1 changed files with 4 additions and 3 deletions

View File

@ -144,15 +144,16 @@ const DefinedAtom *LayoutPass::findAtomFollowedBy(
bool LayoutPass::checkAllPrevAtomsZeroSize(const DefinedAtom *targetAtom) {
const DefinedAtom *atom = _followOnRoots[targetAtom];
while (true) {
AtomToAtomT::iterator targetFollowOnAtomsIter = _followOnNexts.find(atom);
// The target atom must be in the chain of its root.
assert(targetFollowOnAtomsIter != _followOnNexts.end());
if (atom == targetAtom)
return true;
if ((*atom).size() != 0)
// TODO: print warning that an impossible layout is being desired by the
// user.
return false;
AtomToAtomT::iterator targetFollowOnAtomsIter = _followOnNexts.find(atom);
// The target atom must be in the chain of its root.
assert(targetFollowOnAtomsIter != _followOnNexts.end());
atom = targetFollowOnAtomsIter->second;
}
}