[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
This commit is contained in:
Nikita Popov 2022-10-05 14:20:57 +02:00
parent cceb8c068d
commit d785a8eaa2
10 changed files with 0 additions and 46 deletions

View File

@ -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) 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? # TODO: verify the values against LangStandards.def?
set(CLANG_DEFAULT_STD_C "" CACHE STRING set(CLANG_DEFAULT_STD_C "" CACHE STRING
"Default standard to use for C/ObjC code (IDENT from LangStandards.def, empty for platform default)") "Default standard to use for C/ObjC code (IDENT from LangStandards.def, empty for platform default)")

View File

@ -101,7 +101,4 @@
/* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */ /* Spawn a new process clang.exe for the CC1 tool invocation, when necessary */
#cmakedefine01 CLANG_SPAWN_CC1 #cmakedefine01 CLANG_SPAWN_CC1
/* Whether to enable opaque pointers by default */
#cmakedefine01 CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
#endif #endif

View File

@ -6697,9 +6697,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
false)) false))
CmdArgs.push_back("-fmodules-debuginfo"); CmdArgs.push_back("-fmodules-debuginfo");
if (!CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL)
CmdArgs.push_back("-no-opaque-pointers");
ObjCRuntime Runtime = AddObjCRuntimeArgs(Args, Inputs, CmdArgs, rewriteKind); ObjCRuntime Runtime = AddObjCRuntimeArgs(Args, Inputs, CmdArgs, rewriteKind);
RenderObjCOptions(TC, D, RawTriple, Args, Runtime, rewriteKind != RK_None, RenderObjCOptions(TC, D, RawTriple, Args, Runtime, rewriteKind != RK_None,
Input, CmdArgs); Input, CmdArgs);

View File

@ -558,9 +558,6 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
CmdArgs.push_back( CmdArgs.push_back(
Args.MakeArgString("-plugin-opt=jobs=" + Twine(Parallelism))); 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 an explicit debugger tuning argument appeared, pass it along.
if (Arg *A = Args.getLastArg(options::OPT_gTune_Group, if (Arg *A = Args.getLastArg(options::OPT_gTune_Group,
options::OPT_ggdbN_Group)) { options::OPT_ggdbN_Group)) {

View File

@ -5,7 +5,6 @@ llvm_canonicalize_cmake_booleans(
CLANG_BUILD_EXAMPLES CLANG_BUILD_EXAMPLES
CLANG_BUILT_STANDALONE CLANG_BUILT_STANDALONE
CLANG_DEFAULT_PIE_ON_LINUX CLANG_DEFAULT_PIE_ON_LINUX
CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
CLANG_ENABLE_ARCMT CLANG_ENABLE_ARCMT
CLANG_ENABLE_STATIC_ANALYZER CLANG_ENABLE_STATIC_ANALYZER
CLANG_PLUGIN_SUPPORT CLANG_PLUGIN_SUPPORT

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -126,9 +126,6 @@ if config.has_plugins and config.llvm_plugin_ext:
if config.clang_default_pie_on_linux: if config.clang_default_pie_on_linux:
config.available_features.add('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 != '': if config.clang_default_std_cxx != '':
config.available_features.add('default-std-cxx') config.available_features.add('default-std-cxx')

View File

@ -24,7 +24,6 @@ config.have_zlib = @LLVM_ENABLE_ZLIB@
config.have_zstd = @LLVM_ENABLE_ZSTD@ config.have_zstd = @LLVM_ENABLE_ZSTD@
config.clang_arcmt = @CLANG_ENABLE_ARCMT@ config.clang_arcmt = @CLANG_ENABLE_ARCMT@
config.clang_default_pie_on_linux = @CLANG_DEFAULT_PIE_ON_LINUX@ 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_std_cxx = "@CLANG_DEFAULT_STD_CXX@"
config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@" config.clang_default_cxx_stdlib = "@CLANG_DEFAULT_CXX_STDLIB@"
config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@ config.clang_staticanalyzer = @CLANG_ENABLE_STATIC_ANALYZER@