> OK. If this is not obviously beneficial, I don't have any strong opinion
> here.

Same here. It is quiet a bit more complicated and requires patching
llvm too, but it does avoid the double negation. Patches attached.

Cheers,
Rafael
diff --git a/Makefile.config.in b/Makefile.config.in
index 379e988..1c36412 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -253,6 +253,9 @@ ENABLE_CXX1Y = @ENABLE_CXX1Y@
 # When ENABLE_SPLIT_DWARF is enabled, LLVM uses -gfission to build in debug mode.
 ENABLE_SPLIT_DWARF = @ENABLE_SPLIT_DWARF@
 
+# When enabled, clang will have plugin support.
+CLANG_PLUGIN_SUPPORT = @CLANG_PLUGIN_SUPPORT@
+
 # When ENABLE_CLANG_ARCMT is enabled, clang will have ARCMigrationTool.
 ENABLE_CLANG_ARCMT = @ENABLE_CLANG_ARCMT@
 
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 9bebdaa..dd6fc86 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -641,6 +641,20 @@ case "$enableval" in
   *) AC_MSG_ERROR([Invalid setting for --enable-clang-arcmt. Use "yes" or "no"]) ;;
 esac
 
+dnl --enable-clang-plugin-support: check whether to enable plugins in clang
+clang_plugin_support="yes"
+AC_ARG_ENABLE(clang-plugin-support,
+              AS_HELP_STRING([--enable-clang-plugin-support],
+                             [Enable plugin support in clang (default is YES)]),
+                             clang_plugin_support="$enableval",
+                             enableval="yes")
+case "$enableval" in
+  yes) AC_SUBST(CLANG_PLUGIN_SUPPORT,[1]) ;;
+  no)  AC_SUBST(CLANG_PLUGIN_SUPPORT,[0]) ;;
+  default) AC_SUBST(CLANG_PLUGIN_SUPPORT,[1]);;
+  *) AC_MSG_ERROR([Invalid setting for --enable-clang-plugin-support. Use "yes" or "no"]) ;;
+esac
+
 dnl --enable-clang-static-analyzer: check whether to enable static-analyzer
 clang_static_analyzer="yes"
 AC_ARG_ENABLE(clang-static-analyzer,
diff --git a/configure b/configure
index c248f91..3080ea1 100755
--- a/configure
+++ b/configure
@@ -689,6 +689,7 @@ ENABLE_LIBCPP
 ENABLE_CXX1Y
 ENABLE_SPLIT_DWARF
 ENABLE_CLANG_ARCMT
+CLANG_PLUGIN_SUPPORT
 ENABLE_CLANG_STATIC_ANALYZER
 ENABLE_CLANG_REWRITER
 ENABLE_OPTIMIZED
@@ -1407,6 +1408,8 @@ Optional Features:
   --enable-cxx1y          Use c++1y if available (default is NO)
   --enable-split-dwarf    Use split-dwarf if available (default is NO)
   --enable-clang-arcmt    Enable building of clang ARCMT (default is YES)
+  --enable-clang-plugin-support
+                          Enable plugin support in clang (default is YES)
   --enable-clang-static-analyzer
                           Enable building of clang Static Analyzer (default is
                           YES)
@@ -4872,6 +4875,26 @@ echo "$as_me: error: Invalid setting for --enable-clang-arcmt. Use \"yes\" or \"
    { (exit 1); exit 1; }; } ;;
 esac
 
+clang_plugin_support="yes"
+# Check whether --enable-clang-plugin-support was given.
+if test "${enable_clang_plugin_support+set}" = set; then
+  enableval=$enable_clang_plugin_support; clang_plugin_support="$enableval"
+else
+  enableval="yes"
+fi
+
+case "$enableval" in
+  yes) CLANG_PLUGIN_SUPPORT=1
+ ;;
+  no)  CLANG_PLUGIN_SUPPORT=0
+ ;;
+  default) CLANG_PLUGIN_SUPPORT=1
+;;
+  *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-clang-plugin-support. Use \"yes\" or \"no\"" >&5
+echo "$as_me: error: Invalid setting for --enable-clang-plugin-support. Use \"yes\" or \"no\"" >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+
 clang_static_analyzer="yes"
 # Check whether --enable-clang-static-analyzer was given.
 if test "${enable_clang_static_analyzer+set}" = set; then
@@ -20180,6 +20203,7 @@ ENABLE_LIBCPP!$ENABLE_LIBCPP$ac_delim
 ENABLE_CXX1Y!$ENABLE_CXX1Y$ac_delim
 ENABLE_SPLIT_DWARF!$ENABLE_SPLIT_DWARF$ac_delim
 ENABLE_CLANG_ARCMT!$ENABLE_CLANG_ARCMT$ac_delim
+CLANG_PLUGIN_SUPPORT!$CLANG_PLUGIN_SUPPORT$ac_delim
 ENABLE_CLANG_STATIC_ANALYZER!$ENABLE_CLANG_STATIC_ANALYZER$ac_delim
 ENABLE_CLANG_REWRITER!$ENABLE_CLANG_REWRITER$ac_delim
 ENABLE_OPTIMIZED!$ENABLE_OPTIMIZED$ac_delim
@@ -20189,7 +20213,6 @@ ENABLE_WERROR!$ENABLE_WERROR$ac_delim
 ENABLE_EXPENSIVE_CHECKS!$ENABLE_EXPENSIVE_CHECKS$ac_delim
 EXPENSIVE_CHECKS!$EXPENSIVE_CHECKS$ac_delim
 DEBUG_RUNTIME!$DEBUG_RUNTIME$ac_delim
-DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -20231,6 +20254,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+DEBUG_SYMBOLS!$DEBUG_SYMBOLS$ac_delim
 KEEP_SYMBOLS!$KEEP_SYMBOLS$ac_delim
 JIT!$JIT$ac_delim
 TARGET_HAS_JIT!$TARGET_HAS_JIT$ac_delim
@@ -20327,7 +20351,6 @@ LLVM_ETCDIR!$LLVM_ETCDIR$ac_delim
 LLVM_INCLUDEDIR!$LLVM_INCLUDEDIR$ac_delim
 LLVM_INFODIR!$LLVM_INFODIR$ac_delim
 LLVM_MANDIR!$LLVM_MANDIR$ac_delim
-LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -20369,6 +20392,7 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+LLVM_CONFIGTIME!$LLVM_CONFIGTIME$ac_delim
 BINDINGS_TO_BUILD!$BINDINGS_TO_BUILD$ac_delim
 ALL_BINDINGS!$ALL_BINDINGS$ac_delim
 OCAML_LIBDIR!$OCAML_LIBDIR$ac_delim
@@ -20380,7 +20404,7 @@ LIBOBJS!$LIBOBJS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 10; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt
index c003df8..9442ba6 100644
--- a/tools/driver/CMakeLists.txt
+++ b/tools/driver/CMakeLists.txt
@@ -16,11 +16,11 @@ set( LLVM_LINK_COMPONENTS
   Vectorize
   )
 
-option(CLANG_IS_PRODUCTION "Build clang without plugin support" OFF)
+option(CLANG_PLUGIN_SUPPORT "Build clang with plugin support" ON)
 
 # Support plugins. This must be before add_clang_executable as it reads
 # LLVM_NO_DEAD_STRIP.
-if(NOT CLANG_IS_PRODUCTION)
+if(CLANG_PLUGIN_SUPPORT)
   set(LLVM_NO_DEAD_STRIP 1)
 endif()
 
@@ -40,7 +40,7 @@ target_link_libraries(clang
 set_target_properties(clang PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
 
 # Support plugins.
-if(NOT CLANG_IS_PRODUCTION)
+if(CLANG_PLUGIN_SUPPORT)
   set_target_properties(clang PROPERTIES ENABLE_EXPORTS 1)
 endif()
 
diff --git a/tools/driver/Makefile b/tools/driver/Makefile
index c128918..22c8c9f 100644
--- a/tools/driver/Makefile
+++ b/tools/driver/Makefile
@@ -11,12 +11,6 @@ CLANG_LEVEL := ../..
 TOOLNAME = clang
 TOOLALIAS = clang++
 
-# We don't currently expect production Clang builds to be interested in
-# plugins. This is important for startup performance.
-ifdef CLANG_IS_PRODUCTION
-TOOL_NO_EXPORTS := 1
-endif
-
 ifdef CLANG_ORDER_FILE
 TOOL_ORDER_FILE := $(CLANG_ORDER_FILE)
 endif
@@ -24,14 +18,19 @@ endif
 # Include tool version information on OS X.
 TOOL_INFO_PLIST := Info.plist
 
-# Support plugins.
-NO_DEAD_STRIP := 1
-
 # Include this here so we can get the configuration of the targets that have
 # been configured for construction. We have to do this early so we can set up
 # LINK_COMPONENTS before including Makefile.rules
 include $(CLANG_LEVEL)/../../Makefile.config
 
+# Have the option of not supporting plugins. This is important for startup
+# performance.
+ifeq ($(CLANG_PLUGIN_SUPPORT), 1)
+NO_DEAD_STRIP := 1
+else
+TOOL_NO_EXPORTS := 1
+endif
+
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \
                    instrumentation ipo irreader linker objcarcopts option \
                    selectiondag
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to