update for change in arguments of clang's HeaderSearchOptions::AddPath
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 7 Apr 2013 11:20:41 +0000 (7 13:20 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 7 Apr 2013 14:37:48 +0000 (7 16:37 +0200)
In particular, the IsUserSpecified argument has been removed.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
configure.ac
interface/extract_interface.cc

index baf2027..eac09c3 100644 (file)
@@ -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 <clang/Lex/HeaderSearchOptions.h>], [
+               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"
 
index acf7c85..5aa6294 100644 (file)
@@ -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\")))");