[llvm] r372881 - [PatternMatch] Generalize brc_match (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 07:53:06 PDT 2019
Author: fhahn
Date: Wed Sep 25 07:53:06 2019
New Revision: 372881
URL: http://llvm.org/viewvc/llvm-project?rev=372881&view=rev
Log:
[PatternMatch] Generalize brc_match (NFC).
Preparation for D68013.
Modified:
llvm/trunk/include/llvm/IR/PatternMatch.h
Modified: llvm/trunk/include/llvm/IR/PatternMatch.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PatternMatch.h?rev=372881&r1=372880&r2=372881&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PatternMatch.h (original)
+++ llvm/trunk/include/llvm/IR/PatternMatch.h Wed Sep 25 07:53:06 2019
@@ -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_ma
};
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);
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list