This is an archive of the discontinued LLVM Phabricator instance.

[clang] adds `__is_bounded_array` and `__is_unbounded_array` as builtins
ClosedPublic

Authored by cjdb on Oct 4 2022, 9:20 AM.

Details

Summary

This is information that the compiler already has, and should be exposed
so that the library doesn't need to reimplement the exact same
functionality.

This was originally a part of D116280.

Diff Detail

Event Timeline

cjdb created this revision.Oct 4 2022, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 9:20 AM
cjdb requested review of this revision.Oct 4 2022, 9:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2022, 9:20 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cjdb updated this revision to Diff 465057.Oct 4 2022, 9:46 AM

adds missing property

cjdb updated this revision to Diff 465272.Oct 4 2022, 9:28 PM

Changes T/F to static_assert to match D116203

cjdb added a reviewer: Restricted Project.Oct 4 2022, 10:35 PM
shafik added a subscriber: shafik.Oct 5 2022, 10:08 AM

Looks good but let's have Aaron check it out.

clang/lib/Sema/SemaExprCXX.cpp
24

Why also Type.h?

clang/lib/Sema/SemaType.cpp
2630–2633

This feels like an unrelated change.

Is this diagnostic tested anywhere?

cjdb added inline comments.Oct 5 2022, 10:21 AM
clang/lib/Sema/SemaType.cpp
2630–2633

This change hardcodes the first option for err_vla_unsupported, since it now has a %select. No change in relevant tests necessary, since the existing tests should already catch this.

cjdb added inline comments.Oct 5 2022, 10:23 AM
clang/lib/Sema/SemaExprCXX.cpp
24

The most likely reason is that it's come from D116280, and is actually important for one of the child patches (I'm not sure which off the top of my head). I can investigate and move it to the correct one before merging.

erichkeane accepted this revision.Oct 6 2022, 6:16 AM
erichkeane added a subscriber: erichkeane.
erichkeane added inline comments.
clang/lib/Sema/SemaExprCXX.cpp
24

I'd say it isn't particularly important to figure out whichone.

4910

This should make this return 'false' in this case, rather than a success? Not sure about this, but wanted to make sure you were thinking about this.

4915

Same here, not clear if this is the logic you meant.

This revision is now accepted and ready to land.Oct 6 2022, 6:16 AM
cjdb updated this revision to Diff 466314.Oct 8 2022, 4:44 PM
cjdb marked 4 inline comments as done.

applies requested changes, adds documentation

This revision was landed with ongoing or failed builds.Oct 10 2022, 5:39 PM
This revision was automatically updated to reflect the committed changes.