Skip to content
Open
Changes from all 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: 1 addition & 11 deletions clang/include/clang/AST/IgnoreExpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
#include "clang/AST/ExprCXX.h"

namespace clang {
namespace detail {
/// Given an expression E and functions Fn_1,...,Fn_n : Expr * -> Expr *,
/// Return Fn_n(...(Fn_1(E)))
inline Expr *IgnoreExprNodesImpl(Expr *E) { return E; }
template <typename FnTy, typename... FnTys>
Expr *IgnoreExprNodesImpl(Expr *E, FnTy &&Fn, FnTys &&... Fns) {
return IgnoreExprNodesImpl(std::forward<FnTy>(Fn)(E),
std::forward<FnTys>(Fns)...);
}
} // namespace detail

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