mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[GlobalISel] Remove duplicate function using variadic templates. NFC.
I think the initial version of r293172 was trying: std::forward<Args...>(args)... which doesn't compile. This seems like the correct way: std::forward<Args>(args)... llvm-svn: 293214
This commit is contained in:
parent
136e254cdb
commit
bab0dceb1b
@ -129,7 +129,8 @@ public:
|
||||
/// Construct a new operand predicate and add it to the matcher.
|
||||
template <class Kind, class... Args>
|
||||
Kind &addPredicate(Args&&... args) {
|
||||
Predicates.emplace_back(llvm::make_unique<Kind>(std::forward<Args...>(args)...));
|
||||
Predicates.emplace_back(
|
||||
llvm::make_unique<Kind>(std::forward<Args>(args)...));
|
||||
return *static_cast<Kind *>(Predicates.back().get());
|
||||
}
|
||||
|
||||
@ -140,8 +141,8 @@ public:
|
||||
}
|
||||
|
||||
/// Emit a C++ expression that tests whether all the predicates are met.
|
||||
template <class Arg1>
|
||||
void emitCxxPredicatesExpr(raw_ostream &OS, Arg1&& arg1) const {
|
||||
template <class... Args>
|
||||
void emitCxxPredicatesExpr(raw_ostream &OS, Args &&... args) const {
|
||||
if (Predicates.empty()) {
|
||||
OS << "true";
|
||||
return;
|
||||
@ -150,24 +151,7 @@ public:
|
||||
StringRef Separator = "";
|
||||
for (const auto &Predicate : predicates()) {
|
||||
OS << Separator << "(";
|
||||
Predicate->emitCxxPredicateExpr(OS, std::forward<Arg1>(arg1));
|
||||
OS << ")";
|
||||
Separator = " && ";
|
||||
}
|
||||
}
|
||||
|
||||
template <class Arg1, class Arg2>
|
||||
void emitCxxPredicatesExpr(raw_ostream &OS, Arg1&& arg1, Arg2&& arg2) const {
|
||||
if (Predicates.empty()) {
|
||||
OS << "true";
|
||||
return;
|
||||
}
|
||||
|
||||
StringRef Separator = "";
|
||||
for (const auto &Predicate : predicates()) {
|
||||
OS << Separator << "(";
|
||||
Predicate->emitCxxPredicateExpr(OS, std::forward<Arg1>(arg1),
|
||||
std::forward<Arg2>(arg2));
|
||||
Predicate->emitCxxPredicateExpr(OS, std::forward<Args>(args)...);
|
||||
OS << ")";
|
||||
Separator = " && ";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user