Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions llvm/include/llvm/CodeGen/SDPatternMatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ struct Value_match {

explicit Value_match(SDValue Match) : MatchVal(Match) {}

template <typename MatchContext> bool match(const MatchContext &, SDValue N) {
template <typename MatchContext>
bool match(const MatchContext &, SDValue N) const {
if (MatchVal)
return MatchVal == N;
return N.getNode();
Expand Down Expand Up @@ -130,7 +131,8 @@ struct DeferredValue_match {

explicit DeferredValue_match(SDValue &Match) : MatchVal(Match) {}

template <typename MatchContext> bool match(const MatchContext &, SDValue N) {
template <typename MatchContext>
bool match(const MatchContext &, SDValue N) const {
return N == MatchVal;
}
};
Expand Down Expand Up @@ -196,7 +198,8 @@ struct Value_bind {

explicit Value_bind(SDValue &N) : BindVal(N) {}

template <typename MatchContext> bool match(const MatchContext &, SDValue N) {
template <typename MatchContext>
bool match(const MatchContext &, SDValue N) const {
BindVal = N;
return true;
}
Expand Down Expand Up @@ -1203,7 +1206,8 @@ struct CondCode_match {

explicit CondCode_match(ISD::CondCode *CC) : BindCC(CC) {}

template <typename MatchContext> bool match(const MatchContext &, SDValue N) {
template <typename MatchContext>
bool match(const MatchContext &, SDValue N) const {
if (auto *CC = dyn_cast<CondCodeSDNode>(N.getNode())) {
if (CCToMatch && *CCToMatch != CC->get())
return false;
Expand Down
Loading
Loading