Skip to content
  1. Mar 26, 2017
    • Chandler Carruth's avatar
      [IR] Make SwitchInst::CaseIt almost a normal iterator. · 0d256c0f
      Chandler Carruth authored
      This moves it to the iterator facade utilities giving it full random
      access semantics, etc. It can also now be used with standard algorithms
      like std::all_of and std::any_of and range adaptors like llvm::reverse.
      
      Also make the semantics of iterating match what every other iterator
      uses and forbid decrementing past the begin iterator. This was used as
      a hacky way to work around iterator invalidation. However, every
      instance trying to do this failed to actually avoid touching invalid
      iterators despite the clear documentation that the removed and all
      subsequent iterators become invalid including the end iterator. So I've
      added a return of the next iterator to removeCase and rewritten the
      loops that were doing this to correctly follow the iterator pattern of
      either incremneting or removing and assigning fresh values to the
      iterator and the end.
      
      In one case we were trying to go backwards to make this cleaner but it
      doesn't actually work. I've made that code match the code we use
      everywhere else to remove cases as we iterate. This changes the order of
      cases in one test output and I moved that test to CHECK-DAG so it
      wouldn't care -- the order isn't semantically meaningful anyways.
      
      llvm-svn: 298791
      0d256c0f
    • Rui Ueyama's avatar
      Remove unused parameter. · beeab457
      Rui Ueyama authored
      llvm-svn: 298790
      beeab457
    • Rui Ueyama's avatar
      Remove redundant local variables. · cb815ac5
      Rui Ueyama authored
      llvm-svn: 298789
      cb815ac5
    • Rui Ueyama's avatar
      Remove a parameter from adjustExpr. NFC. · b5cb3283
      Rui Ueyama authored
      llvm-svn: 298788
      b5cb3283
    • Rui Ueyama's avatar
      Inline a small lambda. · dfd204fa
      Rui Ueyama authored
      llvm-svn: 298787
      dfd204fa
    • Rui Ueyama's avatar
      Rename C -> Sec and RI -> Rel. · 2f274230
      Rui Ueyama authored
      C is short for Chunk, but we are no longer using that term.
      RI is probably short for relocation iterator, but this is not an interator.
      
      llvm-svn: 298786
      2f274230
    • Rui Ueyama's avatar
      Simplify relocation offset adjustment. · 08aede36
      Rui Ueyama authored
      Previously, relocation offsets are recalculated for .eh_frame sections
      inside the main loop, and that messed up the main loop. This patch
      separates that logic into a dedicated class.
      
      llvm-svn: 298785
      08aede36
    • Gor Nishanov's avatar
      [coroutines] Add codegen for await and yield expressions · 5eb58583
      Gor Nishanov authored
      Details:
      
      Emit suspend expression which roughly looks like:
      
      auto && x = CommonExpr();
      if (!x.await_ready()) {
         llvm_coro_save();
         x.await_suspend(...);     (*)
         llvm_coro_suspend(); (**)
      }
      x.await_resume();
      where the result of the entire expression is the result of x.await_resume()
      
      (*) If x.await_suspend return type is bool, it allows to veto a suspend:
      if (x.await_suspend(...))
         llvm_coro_suspend();
      (**) llvm_coro_suspend() encodes three possible continuations as a switch instruction:
      
      %where-to = call i8 @llvm.coro.suspend(...)
      switch i8 %where-to, label %coro.ret [ ; jump to epilogue to suspend
        i8 0, label %yield.ready   ; go here when resumed
        i8 1, label %yield.cleanup ; go here when destroyed
      ]
      
      llvm-svn: 298784
      5eb58583
  2. Mar 25, 2017
Loading