interface: always pass 4 arguments to HeaderSearchOptions::AddPath
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 19 Oct 2025 20:07:44 +0000 (19 22:07 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 22 Nov 2025 14:26:17 +0000 (22 15:26 +0100)
Optionally passing only 4 arguments was introduced
in isl-0.11.1-24-g1b0a443208 (update for change in arguments of
clang's HeaderSearchOptions::AddPath, Sun Apr 7 13:20:41 2013 +0200),
but this method has been taking 4 arguments since clang 3.3,
while clang 3.5 is documented as the minimal supported version.

Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>
interface/extract_interface.cc
m4/ax_detect_clang.m4

index 0442c23..461e269 100644 (file)
@@ -328,8 +328,6 @@ static void create_preprocessor(CompilerInstance *Clang)
 
 #endif
 
-#ifdef ADDPATH_TAKES_4_ARGUMENTS
-
 /* Add "Path" to the header search options.
  *
  * Do not take into account sysroot, i.e., set ignoreSysRoot to true.
@@ -339,19 +337,6 @@ void add_path(HeaderSearchOptions &HSO, string Path)
        HSO.AddPath(Path, frontend::Angled, false, true);
 }
 
-#else
-
-/* Add "Path" to the header search options.
- *
- * Do not take into account sysroot, i.e., set IsSysRootRelative to false.
- */
-void add_path(HeaderSearchOptions &HSO, string Path)
-{
-       HSO.AddPath(Path, frontend::Angled, true, false, false);
-}
-
-#endif
-
 #ifdef HAVE_SETMAINFILEID
 
 template <typename T>
index af7f9a2..c611734 100644 (file)
@@ -132,13 +132,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <clang/Basic/TargetInfo.h>]], [[
        TargetInfo::CreateTargetInfo(*Diags, TO);
 ]])], [AC_DEFINE([CREATETARGETINFO_TAKES_POINTER], [],
              [Define if TargetInfo::CreateTargetInfo takes pointer])])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
-               [[#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_EGREP_HEADER([getNumParams],
        [clang/AST/CanonicalType.h],
        [AC_DEFINE([getNumArgs], [getNumParams],