From 5256154090295e5d93b982f3be0adfb7d8519828 Mon Sep 17 00:00:00 2001 From: Brenden Blanco Date: Thu, 7 Jul 2016 17:56:03 -0700 Subject: [PATCH] Fix for C++ api change in LLVM 3.9 (#600) Upstream, params() was renamed to parameters(). In order to support both old and new LLVM, use the unchanged param_begin and param_end API. Signed-off-by: Brenden Blanco --- src/cc/frontends/clang/b_frontend_action.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cc/frontends/clang/b_frontend_action.cc b/src/cc/frontends/clang/b_frontend_action.cc index f782dcc..73e888b 100644 --- a/src/cc/frontends/clang/b_frontend_action.cc +++ b/src/cc/frontends/clang/b_frontend_action.cc @@ -265,7 +265,8 @@ bool BTypeVisitor::VisitFunctionDecl(FunctionDecl *D) { // remember the arg names of the current function...first one is the ctx fn_args_.clear(); string preamble = "{"; - for (auto arg : D->params()) { + for (auto arg_it = D->param_begin(); arg_it != D->param_end(); arg_it++) { + auto arg = *arg_it; if (arg->getName() == "") { error(arg->getLocEnd(), "arguments to BPF program definition must be named"); return false; -- 2.7.4