This is an archive of the discontinued LLVM Phabricator instance.

[clang] Allocate 2 bits to store the constexpr specifier kind when serializing
ClosedPublic

Authored by nridge on Oct 17 2021, 8:30 PM.

Details

Summary

Now that consteval and constinit are possible values, 1 bit
is no longer enough.

Fixes https://github.com/clangd/clangd/issues/887

Diff Detail

Event Timeline

nridge created this revision.Oct 17 2021, 8:30 PM
nridge requested review of this revision.Oct 17 2021, 8:30 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 17 2021, 8:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nridge edited the summary of this revision. (Show Details)Oct 17 2021, 8:31 PM

Not sure if clangd is the best place to test this. I'm open to other suggestions.

adamcz accepted this revision.Oct 18 2021, 4:46 AM

Fix LGTM

As for the test, I suggest putting it in clang/test/AST/, maybe in ast-dump-constant-expr? You can write a CHECK-NEXT: thingy to verify that consteval is preserved. The test already runs both with and without AST reader/writer.

This revision is now accepted and ready to land.Oct 18 2021, 4:46 AM
nridge updated this revision to Diff 387057.Nov 13 2021, 8:35 PM

Reworked test to use the framework in clang/test/AST

nridge requested review of this revision.Nov 13 2021, 8:36 PM

Sorry for the delay here.

@adamcz could you kindly have another look to make sure the test changes look ok?

adamcz accepted this revision.Nov 17 2021, 5:39 AM

Looks good. Thanks!

This revision is now accepted and ready to land.Nov 17 2021, 5:39 AM
This revision was landed with ongoing or failed builds.Nov 17 2021, 1:57 PM
This revision was automatically updated to reflect the committed changes.