Commit 8998657c authored by Pete Cooper's avatar Pete Cooper
Browse files

LiveIntervalUpdate validators weren't recorded after the calls to...

LiveIntervalUpdate validators weren't recorded after the calls to std::for_each.  Turns out std::for_each doesn't update the variable passed in for the functor but instead copy constructs a new one.

llvm-svn: 155041
parent dd925742
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1068,9 +1068,9 @@ public:

#ifndef NDEBUG
    LIValidator validator;
    std::for_each(Entering.begin(), Entering.end(), validator);
    std::for_each(Internal.begin(), Internal.end(), validator);
    std::for_each(Exiting.begin(), Exiting.end(), validator);
    validator = std::for_each(Entering.begin(), Entering.end(), validator);
    validator = std::for_each(Internal.begin(), Internal.end(), validator);
    validator = std::for_each(Exiting.begin(), Exiting.end(), validator);
    assert(validator.rangesOk() && "moveAllOperandsFrom broke liveness.");
#endif

@@ -1115,9 +1115,9 @@ public:

#ifndef NDEBUG
    LIValidator validator;
    std::for_each(Entering.begin(), Entering.end(), validator);
    std::for_each(Internal.begin(), Internal.end(), validator);
    std::for_each(Exiting.begin(), Exiting.end(), validator);
    validator = std::for_each(Entering.begin(), Entering.end(), validator);
    validator = std::for_each(Internal.begin(), Internal.end(), validator);
    validator = std::for_each(Exiting.begin(), Exiting.end(), validator);
    assert(validator.rangesOk() && "moveAllOperandsInto broke liveness.");
#endif
  }