From: Sven Verdoolaege Date: Sun, 7 Apr 2013 11:20:41 +0000 (+0200) Subject: update for change in arguments of clang's HeaderSearchOptions::AddPath X-Git-Tag: isl-0.11.2~6 X-Git-Url: https://repo.or.cz/w/isl.git/commitdiff_plain/1b0a4432089a647f419fb4ded6395323424879fd update for change in arguments of clang's HeaderSearchOptions::AddPath In particular, the IsUserSpecified argument has been removed. Signed-off-by: Sven Verdoolaege --- diff --git a/configure.ac b/configure.ac index baf2027f..eac09c3a 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 acf7c85c..5aa6294b 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\")))");