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<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">>;
Index: clang/include/clang/Basic/CodeGenOptions.def
===================================================================
--- clang/include/clang/Basic/CodeGenOptions.def
+++ clang/include/clang/Basic/CodeGenOptions.def
@@ -501,9 +501,6 @@
 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)
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -254,6 +254,7 @@
 - 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
 --------------------------
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D152447: [Clang] Rem... Nikita Popov via Phabricator via cfe-commits

Reply via email to