This is an archive of the discontinued LLVM Phabricator instance.

[clang] Bump AS_GNU to 1
ClosedPublic

Authored by rsandifo-arm on Apr 12 2023, 10:47 AM.

Details

Summary

Following a suggestion from Erich in https://reviews.llvm.org/D148101,
this patch bumps AS_GNU to 1 so that syntax 0 is invalid. It also
asserts that the syntax is in range.

Diff Detail

Event Timeline

rsandifo-arm created this revision.Apr 12 2023, 10:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 10:47 AM
rsandifo-arm requested review of this revision.Apr 12 2023, 10:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2023, 10:47 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Apr 12 2023, 10:51 AM

This LGTM, though curious about the re-ordering.

clang/include/clang/Basic/AttributeCommonInfo.h
135

Did these two ctors swap places somehow? There's something goofy going on here? Or is this just to make the delegation of ctors more sensible?

This revision is now accepted and ready to land.Apr 12 2023, 10:51 AM
erichkeane added inline comments.Apr 12 2023, 10:52 AM
clang/include/clang/Basic/AttributeCommonInfo.h
28

Note for others: we're now at 11 items (10 items + starting at 1), stored in 4 bits. So this doesn't cause problems. In the future, once we're sure the '0' case isn't being used/abused for a while (god help my downstream...), we can start re-using 0.

rsandifo-arm added inline comments.Apr 12 2023, 10:55 AM
clang/include/clang/Basic/AttributeCommonInfo.h
135

Ah, yeah, I should have mentioned that, sorry. The most general constructor was previously the second in the list. Like you say, I moved it up to make the delegation more obvious. The other three keep their relative order.

erichkeane added inline comments.Apr 12 2023, 10:56 AM
clang/include/clang/Basic/AttributeCommonInfo.h
135

Thanks for explaining, sounds good to me.

Gah, sorry. Due to a botched git operation, I posted a first cut with a stupid typo, rather than the version that passed testing.

erichkeane accepted this revision.Apr 12 2023, 1:16 PM
This revision was landed with ongoing or failed builds.Apr 13 2023, 2:16 AM
This revision was automatically updated to reflect the committed changes.