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

Rui Ueyama ruiu at google.com
Mon May 13 18:51:57 PDT 2013


Author: ruiu
Date: Mon May 13 20:51:56 2013
New Revision: 181752

URL: http://llvm.org/viewvc/llvm-project?rev=181752&view=rev
Log:
[lld][LayoutPass] Fix a bug that caused buildbot to fail on some platforms.

Modified:
    lld/trunk/lib/Passes/LayoutPass.cpp

Modified: lld/trunk/lib/Passes/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/LayoutPass.cpp?rev=181752&r1=181751&r2=181752&view=diff
==============================================================================
--- lld/trunk/lib/Passes/LayoutPass.cpp (original)
+++ lld/trunk/lib/Passes/LayoutPass.cpp Mon May 13 20:51:56 2013
@@ -144,15 +144,16 @@ const DefinedAtom *LayoutPass::findAtomF
 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;
   }
 }
 





More information about the llvm-commits mailing list