[clang] d785a8e - [clang] Remove CLANG_ENABLE_OPAQUE_POINTERS cmake option

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 00:46:17 PDT 2022


Author: Nikita Popov
Date: 2022-10-06T09:46:04+02:00
New Revision: d785a8eaa25dd1110dc7b24b16d3b21c9c179837

URL: https://github.com/llvm/llvm-project/commit/d785a8eaa25dd1110dc7b24b16d3b21c9c179837
DIFF: https://github.com/llvm/llvm-project/commit/d785a8eaa25dd1110dc7b24b16d3b21c9c179837.diff

LOG: [clang] Remove CLANG_ENABLE_OPAQUE_POINTERS cmake option

Remove the ability to disable opaque pointers by default in clang.
It is still possible to explicitly disable them via cc1
-no-opaque-pointers.

Differential Revision: https://reviews.llvm.org/D135259

Added: 
    

Modified: 
    clang/CMakeLists.txt
    clang/include/clang/Config/config.h.cmake
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/lib/Driver/ToolChains/CommonArgs.cpp
    clang/test/CMakeLists.txt
    clang/test/lit.cfg.py
    clang/test/lit.site.cfg.py.in

Removed: 
    clang/test/Driver/lto-no-opaque-pointers.c
    clang/test/Driver/lto-opaque-pointers.c
    clang/test/Driver/opaque-pointers-off.c


################################################################################
diff  --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f43fa51a3379c..875bd27e13206 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -189,17 +189,6 @@ set(CLANG_SPAWN_CC1 OFF CACHE BOOL
 
 option(CLANG_DEFAULT_PIE_ON_LINUX "Default to -fPIE and -pie on linux-gnu" ON)
 
-# Manually handle default so we can change the meaning of a cached default.
-set(CLANG_ENABLE_OPAQUE_POINTERS "DEFAULT" CACHE STRING
-    "Enable opaque pointers by default")
-if(CLANG_ENABLE_OPAQUE_POINTERS STREQUAL "DEFAULT")
-  set(CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL ON)
-elseif(CLANG_ENABLE_OPAQUE_POINTERS)
-  set(CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL ON)
-else()
-  set(CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL OFF)
-endif()
-
 # TODO: verify the values against LangStandards.def?
 set(CLANG_DEFAULT_STD_C "" CACHE STRING
   "Default standard to use for C/ObjC code (IDENT from LangStandards.def, empty for platform default)")

diff  --git a/clang/include/clang/Config/config.h.cmake b/clang/include/clang/Config/config.h.cmake
index a4083827e43f8..3ffc2a12a89fe 100644
--- a/clang/include/clang/Config/config.h.cmake
+++ b/clang/include/clang/Config/config.h.cmake
@@ -101,7 +101,4 @@
 /* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */
 #cmakedefine01 CLANG_SPAWN_CC1
 
-/* Whether to enable opaque pointers by default */
-#cmakedefine01 CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
-
 #endif

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index e5fce35793598..4f880c27b2f11 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6697,9 +6697,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
                    false))
     CmdArgs.push_back("-fmodules-debuginfo");
 
-  if (!CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL)
-    CmdArgs.push_back("-no-opaque-pointers");
-
   ObjCRuntime Runtime = AddObjCRuntimeArgs(Args, Inputs, CmdArgs, rewriteKind);
   RenderObjCOptions(TC, D, RawTriple, Args, Runtime, rewriteKind != RK_None,
                     Input, CmdArgs);

diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index d81faa3652285..7f20122722365 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -558,9 +558,6 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
     CmdArgs.push_back(
         Args.MakeArgString("-plugin-opt=jobs=" + Twine(Parallelism)));
 
-  if (!CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL)
-    CmdArgs.push_back(Args.MakeArgString("-plugin-opt=no-opaque-pointers"));
-
   // If an explicit debugger tuning argument appeared, pass it along.
   if (Arg *A = Args.getLastArg(options::OPT_gTune_Group,
                                options::OPT_ggdbN_Group)) {

diff  --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index c3dcc53b78ab5..09394a0f7f730 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -5,7 +5,6 @@ llvm_canonicalize_cmake_booleans(
   CLANG_BUILD_EXAMPLES
   CLANG_BUILT_STANDALONE
   CLANG_DEFAULT_PIE_ON_LINUX
-  CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
   CLANG_ENABLE_ARCMT
   CLANG_ENABLE_STATIC_ANALYZER
   CLANG_PLUGIN_SUPPORT

diff  --git a/clang/test/Driver/lto-no-opaque-pointers.c b/clang/test/Driver/lto-no-opaque-pointers.c
deleted file mode 100644
index 9146ae5da5824..0000000000000
--- a/clang/test/Driver/lto-no-opaque-pointers.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// UNSUPPORTED: enable-opaque-pointers
-// RUN: %clang --target=x86_64-unknown-linux -### %s -flto 2> %t
-// RUN: FileCheck %s < %t
-
-// CHECK: -plugin-opt=no-opaque-pointers

diff  --git a/clang/test/Driver/lto-opaque-pointers.c b/clang/test/Driver/lto-opaque-pointers.c
deleted file mode 100644
index acdf13c21fd41..0000000000000
--- a/clang/test/Driver/lto-opaque-pointers.c
+++ /dev/null
@@ -1,5 +0,0 @@
-// REQUIRES: enable-opaque-pointers
-// RUN: %clang --target=x86_64-unknown-linux -### %s -flto 2> %t
-// RUN: FileCheck %s < %t
-
-// CHECK-NOT: -plugin-opt=no-opaque-pointers

diff  --git a/clang/test/Driver/opaque-pointers-off.c b/clang/test/Driver/opaque-pointers-off.c
deleted file mode 100644
index d498c1a5f82bf..0000000000000
--- a/clang/test/Driver/opaque-pointers-off.c
+++ /dev/null
@@ -1,11 +0,0 @@
-// UNSUPPORTED: enable-opaque-pointers
-/// Test -DCLANG_ENABLE_OPAQUE_POINTERS=OFF.
-
-// RUN: %clang -### --target=aarch64-linux-gnu %s 2>&1 | FileCheck %s
-/// User -Xclang -opaque-pointers overrides the default.
-// RUN: %clang -### --target=aarch64-linux-gnu -Xclang -opaque-pointers %s 2>&1 | FileCheck %s --check-prefix=CHECK2
-
-// CHECK:       "-no-opaque-pointers"
-
-// CHECK2:      "-no-opaque-pointers"
-// CHECK2-SAME: "-opaque-pointers"

diff  --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 278fbdc79c601..055fd0a4324e3 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -126,9 +126,6 @@ def have_host_jit_feature_support(feature_name):
 if config.clang_default_pie_on_linux:
     config.available_features.add('default-pie-on-linux')
 
-if config.clang_enable_opaque_pointers:
-    config.available_features.add('enable-opaque-pointers')
-
 if config.clang_default_std_cxx != '':
     config.available_features.add('default-std-cxx')
 

diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index b5c9b1a463ba6..dc8c3fa554307 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -24,7 +24,6 @@ config.have_zlib = @LLVM_ENABLE_ZLIB@
 config.have_zstd = @LLVM_ENABLE_ZSTD@
 config.clang_arcmt = @CLANG_ENABLE_ARCMT@
 config.clang_default_pie_on_linux = @CLANG_DEFAULT_PIE_ON_LINUX@
-config.clang_enable_opaque_pointers = @CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL@
 config.clang_default_std_cxx = "@CLANG_DEFAULT_STD_CXX@"
 config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
 config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@


        


More information about the cfe-commits mailing list