This is an archive of the discontinued LLVM Phabricator instance.

[CGTypes] Remove recursion protection
ClosedPublic

Authored by nikic on Jun 15 2023, 1:11 AM.

Details

Summary

With opaque pointers, it should no longer be necessary to protect against recursion when converting Clang types to LLVM types.

Dropping this entire code passes check-clang and llvm-test-suite, but I'm not entirely confident that there aren't remaining edge cases.

Diff Detail

Event Timeline

nikic created this revision.Jun 15 2023, 1:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2023, 1:11 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
nikic requested review of this revision.Jun 15 2023, 1:11 AM
efriedma accepted this revision.Jun 15 2023, 12:55 PM

LGTM

I skimmed the code, and I don't think there's any way you can end up recursively visiting in a bad way, given standard restrictions on recursive types. (For member pointers, we do query properties of the pointed-to type in some cases, but we don't actually try to convert it to an IR type, so that shouldn't be an issue.)

I remember spending a lot of time on making recursive types/globals work correctly... but I'm not sad to see the complexity go away.

This revision is now accepted and ready to land.Jun 15 2023, 12:55 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 16 2023, 4:07 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript