aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-06-08 16:43:26 +0200
committerNikita Popov <npopov@redhat.com>2023-06-08 17:52:20 +0200
commit066fb7a58c5a0dd518d0841ed8f32f86d9f798ec (patch)
tree71e6b096398f5cb30c8f2650340a5e13589d14a0
parente4c1fa734ea7cd8f76f221e99cc727c18858183e (diff)
downloadllvm-066fb7a58c5a0dd518d0841ed8f32f86d9f798ec.zip
llvm-066fb7a58c5a0dd518d0841ed8f32f86d9f798ec.tar.gz
llvm-066fb7a58c5a0dd518d0841ed8f32f86d9f798ec.tar.bz2
[Clang] Remove -no-opaque-pointers cc1 flag
Migration of clang tests to opaque pointers is finished, so remove the -no-opaque-pointers flag. Differential Revision: https://reviews.llvm.org/D152447
-rw-r--r--clang/docs/ReleaseNotes.rst1
-rw-r--r--clang/include/clang/Basic/CodeGenOptions.def3
-rw-r--r--clang/include/clang/Driver/Options.td7
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp4
-rw-r--r--clang/test/CodeGen/opaque-pointers-flag.c25
-rw-r--r--clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl10
-rw-r--r--llvm/docs/OpaquePointers.rst5
7 files changed, 4 insertions, 51 deletions
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index b17e746..85573dc 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -254,6 +254,7 @@ Removed Compiler Flags
- The CodeGen flag `-lower-global-dtors-via-cxa-atexit` which affects how global
destructors are lowered for MachO is removed without replacement. The default
of `-lower-global-dtors-via-cxa-atexit=true` is now the only supported way.
+- The cc1 flag ``-no-opaque-pointers`` has been removed.
Attribute Changes in Clang
--------------------------
diff --git a/clang/include/clang/Basic/CodeGenOptions.def b/clang/include/clang/Basic/CodeGenOptions.def
index 53d92c4..9cd911e 100644
--- a/clang/include/clang/Basic/CodeGenOptions.def
+++ b/clang/include/clang/Basic/CodeGenOptions.def
@@ -501,9 +501,6 @@ CODEGENOPT(SkipRaxSetup, 1, 0)
ENUM_CODEGENOPT(ZeroCallUsedRegs, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind,
5, llvm::ZeroCallUsedRegs::ZeroCallUsedRegsKind::Skip)
-/// Whether to use opaque pointers.
-CODEGENOPT(OpaquePointers, 1, 0)
-
/// Modify C++ ABI to returning `this` pointer from constructors and
/// non-deleting destructors. (No effect on Microsoft ABI.)
CODEGENOPT(CtorDtorReturnThis, 1, 0)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 7fad5b2..7934afa 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -6029,13 +6029,6 @@ defm enable_noundef_analysis : BoolOption<"",
PosFlag<SetTrue, [], "Enable">,
NegFlag<SetFalse, [], "Disable">,
BothFlags<[], " analyzing function argument and return types for mandatory definedness">>;
-defm opaque_pointers : BoolOption<"",
- "opaque-pointers",
- CodeGenOpts<"OpaquePointers">,
- DefaultTrue,
- PosFlag<SetTrue, [], "Enable">,
- NegFlag<SetFalse, [], "Disable">,
- BothFlags<[], " opaque pointers">>;
def discard_value_names : Flag<["-"], "discard-value-names">,
HelpText<"Discard value names in LLVM IR">,
MarshallingInfoFlag<CodeGenOpts<"DiscardValueNames">>;
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index b93477f..4aa51e9 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -1047,8 +1047,6 @@ CodeGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
if (BA != Backend_EmitNothing && !OS)
return nullptr;
- VMContext->setOpaquePointers(CI.getCodeGenOpts().OpaquePointers);
-
// Load bitcode modules to link with, if we need to.
if (LinkModules.empty())
for (const CodeGenOptions::BitcodeFileToLink &F :
@@ -1106,8 +1104,6 @@ CodeGenAction::loadModule(MemoryBufferRef MBRef) {
CompilerInstance &CI = getCompilerInstance();
SourceManager &SM = CI.getSourceManager();
- VMContext->setOpaquePointers(CI.getCodeGenOpts().OpaquePointers);
-
// For ThinLTO backend invocations, ensure that the context
// merges types based on ODR identifiers. We also need to read
// the correct module out of a multi-module bitcode file.
diff --git a/clang/test/CodeGen/opaque-pointers-flag.c b/clang/test/CodeGen/opaque-pointers-flag.c
deleted file mode 100644
index 1fbff99..0000000
--- a/clang/test/CodeGen/opaque-pointers-flag.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=TYPED
-// RUN: %clang_cc1 -opaque-pointers -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=OPAQUE
-
-// TYPED-LABEL: @test(
-// TYPED-NEXT: entry:
-// TYPED-NEXT: [[P_ADDR:%.*]] = alloca ptr, align 8
-// TYPED-NEXT: store ptr [[P:%.*]], ptr [[P_ADDR]], align 8
-// TYPED-NEXT: [[TMP0:%.*]] = load ptr, ptr [[P_ADDR]], align 8
-// TYPED-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 1
-// TYPED-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
-// TYPED-NEXT: ret i32 [[TMP1]]
-//
-// OPAQUE-LABEL: @test(
-// OPAQUE-NEXT: entry:
-// OPAQUE-NEXT: [[P_ADDR:%.*]] = alloca ptr, align 8
-// OPAQUE-NEXT: store ptr [[P:%.*]], ptr [[P_ADDR]], align 8
-// OPAQUE-NEXT: [[TMP0:%.*]] = load ptr, ptr [[P_ADDR]], align 8
-// OPAQUE-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP0]], i64 1
-// OPAQUE-NEXT: [[TMP1:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
-// OPAQUE-NEXT: ret i32 [[TMP1]]
-//
-int test(int *p) {
- return p[1];
-}
diff --git a/clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl b/clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
deleted file mode 100644
index 93220ef..0000000
--- a/clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
+++ /dev/null
@@ -1,10 +0,0 @@
-// RUN: %clang_cc1 -no-opaque-pointers -emit-llvm -o - -triple spirv64 %s | FileCheck %s
-
-// Check that we have a way to recover pointer
-// types for extern function prototypes (see PR56660).
-extern void foo(global int * ptr);
-kernel void k(global int * ptr) {
- foo(ptr);
-}
-//CHECK: define spir_kernel void @k(i32 {{.*}}*
-//CHECK: declare spir_func void @foo(i32 {{.*}}*
diff --git a/llvm/docs/OpaquePointers.rst b/llvm/docs/OpaquePointers.rst
index 64c30f8..9f2d6e5 100644
--- a/llvm/docs/OpaquePointers.rst
+++ b/llvm/docs/OpaquePointers.rst
@@ -289,6 +289,8 @@ avoid breaking remaining tests.
The following typed pointer functionality has already been removed:
* The ``CLANG_ENABLE_OPAQUE_POINTERS`` cmake flag is no longer supported.
+* The ``-no-opaque-pointers`` cc1 clang flag is no longer supported.
+* The ``-plugin-opt=no-opaque-pointers`` LTO flag is no longer supported.
* C APIs that do not support opaque pointers (like ``LLVMBuildLoad``) are no
longer supported.
* Typed pointer IR and bitcode is implicitly upgraded to use opaque pointers,
@@ -296,6 +298,5 @@ The following typed pointer functionality has already been removed:
The following typed pointer functionality is still to be removed:
-* The ``-no-opaque-pointers`` cc1 flag, ``-opaque-pointers=0`` opt flag and
- ``-plugin-opt=no-opaque-pointers`` lto flag.
+* The ``-opaque-pointers=0`` opt flag.
* Support for typed pointers in LLVM libraries.