This is an archive of the discontinued LLVM Phabricator instance.

[OpaquePtrs][Clang] Add -normalize-opaque-pointers cc1 option
AbandonedPublic

Authored by nikic on Mar 25 2022, 9:15 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

This is a reboot of D117778 on the clang side. This option will generate IR using typed pointers and then convert it to opaque pointers at the end for printing purposes only. This allows making the test output compatible with opaque pointers, while continuing to test typed pointers.

The migration plan here would be:

  1. Gradually convert ~2.5k affected clang tests to -normalize-opaque-pointers (without losing typed pointer coverage).
  2. Flip the default to enable opaque pointers in clang.
  3. Gradually convert tests to use opaque pointers in llvm/, while losing typed pointer coverage.
  4. Flip the default to enable opaque pointers in LLVM.

Alternatively we can directly migrate clang tests to use opaque pointers before the default switch. This would carry a higher risk of breaking typed pointer support while it is still the default.

This patch just migrates a single test, but I have some half-finished automation for helping with mass migration.

Diff Detail

Event Timeline

nikic created this revision.Mar 25 2022, 9:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2022, 9:15 AM
nikic requested review of this revision.Mar 25 2022, 9:15 AM
nikic abandoned this revision.Apr 4 2022, 8:05 AM

As indicated in https://discourse.llvm.org/t/enabling-opaque-pointers-by-default/61322/9?u=nikic, I no longer think that this approach makes sense.