OSDN Git Service

[GlobalISel] Return an Expected<RuleMatcher> for each SDAG pattern. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 10 Feb 2017 04:00:17 +0000 (04:00 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 10 Feb 2017 04:00:17 +0000 (04:00 +0000)
commitde17164c61a65ce9c26bebddf7568e89b725f980
tree4a37427b01901a01b78cb814f142c108a94321b2
parent652f08ccd663630d9861df76107aae32d00f1956
[GlobalISel] Return an Expected<RuleMatcher> for each SDAG pattern. NFC.

Instead of emitting the matcher code directly, return the rule matcher
and the skip reason as an Expected<RuleMatcher>.

This will let us record all matchers and process them before emission.

It's a somewhat unconventional use of Error, but it's nicer than, say,
std::pair, because of the bool conversions.

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

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