interface: always use clang driver to obtain command line arguments
authorSven Verdoolaege <sven.verdoolaege@gmail.com>
Sun, 19 Oct 2025 17:21:35 +0000 (19 19:21 +0200)
committerSven Verdoolaege <sven.verdoolaege@gmail.com>
Sat, 22 Nov 2025 14:26:17 +0000 (22 15:26 +0100)
This options was introduced in isl-0.08-32-g518637043d (use the clang driver
to obtain command line arguments for the clang frontend,
Sun Nov 13 15:39:55 2011 +0100), but the original behavior
is only needed for versions of clang before clang 3.0,
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 81c349f..f9aac53 100644 (file)
@@ -179,8 +179,6 @@ struct MyASTConsumer : public ASTConsumer {
        }
 };
 
-#ifdef USE_ARRAYREF
-
 #ifdef HAVE_CXXISPRODUCTION
 static Driver *construct_driver(const char *binary, DiagnosticsEngine &Diags)
 {
@@ -292,16 +290,6 @@ static CompilerInvocation *construct_invocation(const char *filename,
        return invocation;
 }
 
-#else
-
-static CompilerInvocation *construct_invocation(const char *filename,
-       DiagnosticsEngine &Diags)
-{
-       return NULL;
-}
-
-#endif
-
 #ifdef HAVE_BASIC_DIAGNOSTICOPTIONS_H
 
 static TextDiagnosticPrinter *construct_printer(void)
index efb528f..c774a6b 100644 (file)
@@ -97,15 +97,11 @@ AC_EGREP_HEADER([getImmediateExpansionRange], [clang/Basic/SourceManager.h],
        [getImmediateInstantiationRange],
        [Define to getImmediateInstantiationRange for older versions of clang])]
 )
-AC_EGREP_HEADER([ArrayRef], [clang/Driver/Driver.h],
-       [AC_DEFINE([USE_ARRAYREF], [],
-               [Define if Driver::BuildCompilation takes ArrayRef])
-       AC_EGREP_HEADER([ArrayRef.*CommandLineArgs],
-               [clang/Frontend/CompilerInvocation.h],
-               [AC_DEFINE([CREATE_FROM_ARGS_TAKES_ARRAYREF], [],
-                       [Define if CompilerInvocation::CreateFromArgs takes
-                        ArrayRef])
-               ])
+AC_EGREP_HEADER([ArrayRef.*CommandLineArgs],
+       [clang/Frontend/CompilerInvocation.h],
+       [AC_DEFINE([CREATE_FROM_ARGS_TAKES_ARRAYREF], [],
+               [Define if CompilerInvocation::CreateFromArgs takes
+                ArrayRef])
        ])
 AC_EGREP_HEADER([CXXIsProduction], [clang/Driver/Driver.h],
        [AC_DEFINE([HAVE_CXXISPRODUCTION], [],