diff options
author | Quentin Colombet <qcolombet@apple.com> | 2016-04-21 21:01:13 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2016-04-21 21:01:13 +0000 |
commit | 23341a84cacfa57722a6d0807846f164317f9d8d (patch) | |
tree | a17a3b115192cecd2616b2d9b8495eab6f2beaaa /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 95590f4b7bba50a05807de14aae5eb9678937dc5 (diff) | |
download | bcm5719-llvm-23341a84cacfa57722a6d0807846f164317f9d8d.tar.gz bcm5719-llvm-23341a84cacfa57722a6d0807846f164317f9d8d.zip |
[MachineBasicBlock] Make the pass argument truly mandatory when
splitting edges.
MachineBasicBlock::SplitCriticalEdges will crash if a nullptr would have
been passed for the Pass argument. Do not allow that by turning this
argument into a reference.
The alternative would have been to make the Pass a truly optional
argument, but although this is easy to do, I was afraid users using it
like this would not be aware the livness information, dominator tree and
such would silently be broken.
llvm-svn: 267052
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineSink.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index c42281b1455..13924edbb94 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -284,7 +284,7 @@ bool MachineSinking::runOnMachineFunction(MachineFunction &MF) { // If we have anything we marked as toSplit, split it now. for (auto &Pair : ToSplit) { - auto NewSucc = Pair.first->SplitCriticalEdge(Pair.second, this); + auto NewSucc = Pair.first->SplitCriticalEdge(Pair.second, *this); if (NewSucc != nullptr) { DEBUG(dbgs() << " *** Splitting critical edge:" " BB#" << Pair.first->getNumber() |