This is an archive of the discontinued LLVM Phabricator instance.

Handle char{8,16,32} and wchar_t in ASTContext::getIntegerRank()
ClosedPublic

Authored by hans on Dec 6 2022, 6:25 AM.

Details

Summary

They were previously not handled, causing the llvm_unreachable with "getIntegerRank(): not a built-in integer" message to be hit.

The test case is derived from how we hit it in Chromium (crbug.com/1396142). I tried to come up with something more direct, but this is the best I could find.

Diff Detail

Event Timeline

hans created this revision.Dec 6 2022, 6:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 6:25 AM
hans requested review of this revision.Dec 6 2022, 6:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 6:25 AM
tahonermann requested changes to this revision.Dec 6 2022, 7:31 AM
tahonermann added a subscriber: tahonermann.

The direction of the changes looks right. I noted a couple of minor considerations.

clang/lib/AST/ASTContext.cpp
7109

This should technically be UnsignedCharTy though it probably doesn't matter.

clang/test/SemaCXX/vector-bool.cpp
93–104 ↗(On Diff #480462)

This source file purports to be specific to vectors with bool element type. These additions look like they would be more at home in clang/test/SemaCXX/vector.cpp.

This revision now requires changes to proceed.Dec 6 2022, 7:31 AM
hans updated this revision to Diff 480538.Dec 6 2022, 10:34 AM
hans marked 2 inline comments as done.

Address comments.

clang/lib/AST/ASTContext.cpp
7109

Done.

clang/test/SemaCXX/vector-bool.cpp
93–104 ↗(On Diff #480462)

Done.

tahonermann accepted this revision.Dec 6 2022, 2:26 PM

Looks good to me!

This revision is now accepted and ready to land.Dec 6 2022, 2:26 PM
This revision was landed with ongoing or failed builds.Dec 7 2022, 7:16 AM
This revision was automatically updated to reflect the committed changes.