OSDN Git Service

Re-commit: [globalisel][tablegen] Keep track of the insertion point while adding...
authorDaniel Sanders <daniel_l_sanders@apple.com>
Tue, 31 Oct 2017 23:03:18 +0000 (23:03 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Tue, 31 Oct 2017 23:03:18 +0000 (23:03 +0000)
commitb7e9d79775950e125976271ebbd7a4fcf0fa740d
tree317828665915cc3101c14747beca0a91af67f20a
parent90b71c2f3dd4e75690caba8697e956ad9723d746
Re-commit: [globalisel][tablegen] Keep track of the insertion point while adding BuildMIAction's. NFC

Multi-instruction emission needs to ensure the the instructions are generated
a depth-first fashion. For example:
(ADDWrr (SUBWrr a, b), c)
needs to emit the SUBWrr before the ADDWrr. However, our walk over
TreePatternNode's is highly context sensitive which makes it difficult to append
BuildMIActions in the order we want. To fix this, we now keep track of the
insertion point as we add actions. This will allow multi-insn emission to insert
BuildMI's in the correct place.

The previous commit failed on the Ubuntu bots using GCC 4.8. These bots lack the
const_iterator forms of insert() and emplace() that were added in C++11. As a
result I've switched the const_iterators to iterators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317049 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/GlobalISelEmitter.cpp