From 1b0a4432089a647f419fb4ded6395323424879fd Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 7 Apr 2013 13:20:41 +0200 Subject: [PATCH] update for change in arguments of clang's HeaderSearchOptions::AddPath In particular, the IsUserSpecified argument has been removed. Signed-off-by: Sven Verdoolaege --- configure.ac | 6 ++++++ interface/extract_interface.cc | 18 +++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index baf2027..eac09c3 100644 --- a/configure.ac +++ b/configure.ac @@ -184,6 +184,12 @@ system) Clang->createDiagnostics(client); ], [], [AC_DEFINE([CREATEDIAGNOSTICS_TAKES_ARG], [], [Define if CompilerInstance::createDiagnostics takes argc and argv])]) + AC_TRY_COMPILE([#include ], [ + using namespace clang; + HeaderSearchOptions HSO; + HSO.AddPath("", frontend::Angled, false, false); + ], [AC_DEFINE([ADDPATH_TAKES_4_ARGUMENTS], [], + [Define if HeaderSearchOptions::AddPath takes 4 arguments])]) AC_LANG_POP CPPFLAGS="$SAVE_CPPFLAGS" diff --git a/interface/extract_interface.cc b/interface/extract_interface.cc index acf7c85..5aa6294 100644 --- a/interface/extract_interface.cc +++ b/interface/extract_interface.cc @@ -254,6 +254,22 @@ static void create_diagnostics(CompilerInstance *Clang) #endif +#ifdef ADDPATH_TAKES_4_ARGUMENTS + +void add_path(HeaderSearchOptions &HSO, string Path) +{ + HSO.AddPath(Path, frontend::Angled, false, false); +} + +#else + +void add_path(HeaderSearchOptions &HSO, string Path) +{ + HSO.AddPath(Path, frontend::Angled, true, false, false); +} + +#endif + int main(int argc, char *argv[]) { llvm::cl::ParseCommandLineOptions(argc, argv); @@ -278,7 +294,7 @@ int main(int argc, char *argv[]) HSO.ResourceDir = ResourceDir; for (int i = 0; i < Includes.size(); ++i) - HSO.AddPath(Includes[i], frontend::Angled, true, false, false); + add_path(HSO, Includes[i]); PO.addMacroDef("__isl_give=__attribute__((annotate(\"isl_give\")))"); PO.addMacroDef("__isl_keep=__attribute__((annotate(\"isl_keep\")))"); -- 2.7.4