5 Commits

Author SHA1 Message Date
Florian Hahn
6881b02b33 [IR/BasicBlockTest] Fix asan failure introduced in rL330316.
The argument has to be deleted after the module containing the function
gets deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330320 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-19 12:06:26 +00:00
Florian Hahn
848303cb28 [BasicBlock] Add instructionsWithoutDebug methods to skip debug insts.
Reviewers: aprantl, vsk, mattd, chandlerc

Reviewed By: aprantl, vsk

Differential Revision: https://reviews.llvm.org/D45657


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330316 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-19 09:48:07 +00:00
Matt Arsenault
0598347e4d IR: Fix BasicBlock::phis for empty blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321567 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-29 19:25:53 +00:00
Daniel Jasper
0559b4fa45 Remove unnecessary double-assignment triggering -Wsequence-point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303974 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 12:07:12 +00:00
Chandler Carruth
a1a0cf0a7b [IR] Add an iterator and range accessor for the PHI nodes of a basic
block.

This allows writing much more natural and readable range based for loops
directly over the PHI nodes. It also takes advantage of the same tricks
for terminating the sequence as the hand coded versions.

I've replaced one example of this mostly to showcase the difference and
I've added a unit test to make sure the facilities really work the way
they're intended. I want to use this inside of SimpleLoopUnswitch but it
seems generally nice.

Differential Revision: https://reviews.llvm.org/D33533

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303964 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 03:10:00 +00:00