[PATCH] D152447: [Clang] Remove -no-opaque-pointers cc1 flag

2023-06-08 Thread Nikita Popov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG066fb7a58c5a: [Clang] Remove -no-opaque-pointers cc1 flag 
(authored by nikic).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D152447?vs=529597&id=529620#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152447/new/

https://reviews.llvm.org/D152447

Files:
  clang/docs/ReleaseNotes.rst
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CodeGenAction.cpp
  clang/test/CodeGen/opaque-pointers-flag.c
  clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
  llvm/docs/OpaquePointers.rst

Index: llvm/docs/OpaquePointers.rst
===
--- llvm/docs/OpaquePointers.rst
+++ llvm/docs/OpaquePointers.rst
@@ -289,6 +289,8 @@
 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 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.
Index: clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl
===
--- 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 {{.*}}*
Index: clang/test/CodeGen/opaque-pointers-flag.c
===
--- 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];
-}
Index: clang/lib/CodeGen/CodeGenAction.cpp
===
--- clang/lib/CodeGen/CodeGenAction.cpp
+++ clang/lib/CodeGen/CodeGenAction.cpp
@@ -1047,8 +1047,6 @@
   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 @@
   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.
Index: clang/include/clang/Driver/Options.td
===
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -6029,13 +6029,6 @@
   PosFlag,
   NegFlag,
   BothFlags<[], " analyzing function argument and return types for mandatory definedness">>;
-defm opaque_pointers : BoolOption<"",
-  "opaque-pointers",
-  CodeGenOpts<"Op

[PATCH] D152447: [Clang] Remove -no-opaque-pointers cc1 flag

2023-06-09 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added subscribers: t.p.northover, dblaikie.
dblaikie added a comment.

(I hope this doesn't come off as condescending/patronizing, I mean it quite 
genuinely)

A deep thanks to everyone who worked on this, especially @aeubanks and @nikic, 
and @t.p.northover - it's been a long project and I really appreciate you folks 
picking up where I stalled out years ago/paying down the technical debt I 
created (which I'm sorry about).
Starting with 
https://lists.llvm.org/pipermail/llvm-dev/2015-February/081822.html and the 
first change, I think, was D7655 , so... 8 
years, 4 months? Glad it's come along.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152447/new/

https://reviews.llvm.org/D152447

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits