Skip to content

Commit b7188ea

Browse files
committed
[clang][NFC] Simplify implementation of IgnoreExprNodes
1 parent a7f1910 commit b7188ea

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

clang/include/clang/AST/IgnoreExpr.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@
1717
#include "clang/AST/ExprCXX.h"
1818

1919
namespace clang {
20-
namespace detail {
21-
/// Given an expression E and functions Fn_1,...,Fn_n : Expr * -> Expr *,
22-
/// Return Fn_n(...(Fn_1(E)))
23-
inline Expr *IgnoreExprNodesImpl(Expr *E) { return E; }
24-
template <typename FnTy, typename... FnTys>
25-
Expr *IgnoreExprNodesImpl(Expr *E, FnTy &&Fn, FnTys &&... Fns) {
26-
return IgnoreExprNodesImpl(std::forward<FnTy>(Fn)(E),
27-
std::forward<FnTys>(Fns)...);
28-
}
29-
} // namespace detail
3020

3121
/// Given an expression E and functions Fn_1,...,Fn_n : Expr * -> Expr *,
3222
/// Recursively apply each of the functions to E until reaching a fixed point.
@@ -35,7 +25,7 @@ template <typename... FnTys> Expr *IgnoreExprNodes(Expr *E, FnTys &&... Fns) {
3525
Expr *LastE = nullptr;
3626
while (E != LastE) {
3727
LastE = E;
38-
E = detail::IgnoreExprNodesImpl(E, std::forward<FnTys>(Fns)...);
28+
((E = std::forward<FnTys>(Fns)(E)), ...);
3929
}
4030
return E;
4131
}

0 commit comments

Comments
 (0)