Details
- Reviewers
ldionne erichkeane aaron.ballman pengfei MaskRay urnathan rsmith phosek EricWF compnerd rjmccall - Group Reviewers
Restricted Project - Commits
- rGa23652f6f9d8: [demangler] Support C23 _BitInt type
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Thank you for this! It looks correct to me, but the changes should probably come with some test coverage as well.
There are actually some tests in libcxxabi/test/test_demangle.pass.cpp, but since the file is too large, phab folds it as a binary file :-(
LGTM! Please be sure to wait for someone from libcxxabi to approve before landing, though.
yeah, that's getting problematic. I wonder if we should break out all the testcases to a set of files in a subdir that the testprogram reads?
I wonder if there is value, for backwards compatibility to ALSO parse the old _ExtInt mangling?
@erichkeane, I'm not sure what _ExtInt was mangled to in the past, but it now is also mangled as DB/DU using the latest clang, so it's enough to demangle DB and DU IMO.
$ echo 'int foo(_ExtInt(3), unsigned _ExtInt(5)) {}' | ./builds/dev/bin/clang -S -emit-llvm -xc++ - -o - 2>/dev/null | grep '^define' define dso_local noundef i32 @_Z3fooDB3_DU5_(i3 noundef signext %0, i5 noundef zeroext %1) #0 {
@aaron.ballman, I also uploaded the test as a small diff using the web interface (instead of the whole file uploaded by arc), so we can see the test change now :-)
libcxxabi/src/demangle/ItaniumDemangle.h | ||
---|---|---|
498–500 | Done. Thanks! |
I went to look it up, we used to mangle it as a 'struct', so it demangled anyway (so _ExtInt13 was : U7_ExtIntILi13, so void foo(_ExtInt(13)) was _Z3fooU7_ExtIntILi13EEi.
$ echo 'int foo(_ExtInt(3), unsigned _ExtInt(5)) {}' | ./builds/dev/bin/clang -S -emit-llvm -xc++ - -o - 2>/dev/null | grep '^define' define dso_local noundef i32 @_Z3fooDB3_DU5_(i3 noundef signext %0, i5 noundef zeroext %1) #0 {@aaron.ballman, I also uploaded the test as a small diff using the web interface (instead of the whole file uploaded by arc), so we can see the test change now :-)
looks good. You'll need to adjust for the ItaniumNodes.def file replacing FOR_EACH_NODE macro, but that'll be obvious.
Now that D120905 is landed please reword this as
(See NoexceptSpec as an example). This will handle parens inside Size if this is inside template arg list.