diff options
| author | Florian Hahn <flo@fhahn.com> | 2019-09-25 14:53:06 +0000 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2019-09-25 14:53:06 +0000 |
| commit | f8067c7f7c774899c18c03e6b4e0375350436bac (patch) | |
| tree | 386555964485aad1bb5ab02af28f1309969afa66 | |
| parent | 71472a3eeceb9ea513a1d3c672fc2e47d77cc741 (diff) | |
| download | bcm5719-llvm-f8067c7f7c774899c18c03e6b4e0375350436bac.tar.gz bcm5719-llvm-f8067c7f7c774899c18c03e6b4e0375350436bac.zip | |
[PatternMatch] Generalize brc_match (NFC).
Preparation for D68013.
llvm-svn: 372881
| -rw-r--r-- | llvm/include/llvm/IR/PatternMatch.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/include/llvm/IR/PatternMatch.h b/llvm/include/llvm/IR/PatternMatch.h index 4be032bcb98..05fa37b1812 100644 --- a/llvm/include/llvm/IR/PatternMatch.h +++ b/llvm/include/llvm/IR/PatternMatch.h @@ -1334,11 +1334,13 @@ struct br_match { inline br_match m_UnconditionalBr(BasicBlock *&Succ) { return br_match(Succ); } -template <typename Cond_t> struct brc_match { +template <typename Cond_t, typename TrueBlock_t, typename FalseBlock_t> +struct brc_match { Cond_t Cond; - BasicBlock *&T, *&F; + TrueBlock_t T; + FalseBlock_t F; - brc_match(const Cond_t &C, BasicBlock *&t, BasicBlock *&f) + brc_match(const Cond_t &C, const TrueBlock_t &t, const FalseBlock_t &f) : Cond(C), T(t), F(f) {} template <typename OpTy> bool match(OpTy *V) { @@ -1353,8 +1355,9 @@ template <typename Cond_t> struct brc_match { }; template <typename Cond_t> -inline brc_match<Cond_t> m_Br(const Cond_t &C, BasicBlock *&T, BasicBlock *&F) { - return brc_match<Cond_t>(C, T, F); +inline brc_match<Cond_t, BasicBlock *&, BasicBlock *&> +m_Br(const Cond_t &C, BasicBlock *&T, BasicBlock *&F) { + return brc_match<Cond_t, BasicBlock *&, BasicBlock *&>(C, T, F); } //===----------------------------------------------------------------------===// |

