Skip to content

Commit

Permalink
[Clang] Remove -no-opaque-pointers cc1 flag
Browse files Browse the repository at this point in the history
Migration of clang tests to opaque pointers is finished, so remove
the -no-opaque-pointers flag.

Differential Revision: https://reviews.llvm.org/D152447
  • Loading branch information
nikic committed Jun 8, 2023
1 parent e4c1fa7 commit 066fb7a
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 51 deletions.
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------------
Expand Down
3 changes: 0 additions & 3 deletions clang/include/clang/Basic/CodeGenOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -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">>;
Expand Down
4 changes: 0 additions & 4 deletions clang/lib/CodeGen/CodeGenAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down Expand Up @@ -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.
Expand Down
25 changes: 0 additions & 25 deletions clang/test/CodeGen/opaque-pointers-flag.c

This file was deleted.

10 changes: 0 additions & 10 deletions clang/test/CodeGenOpenCL/opaque-ptr-spirv.cl

This file was deleted.

5 changes: 3 additions & 2 deletions llvm/docs/OpaquePointers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,14 @@ 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,
unless ``-opaque-pointers=0`` is passed.

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.

0 comments on commit 066fb7a

Please sign in to comment.