This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Annotate constructor/destructor names
ClosedPublic

Authored by owenpan on Aug 15 2023, 4:25 AM.

Diff Detail

Event Timeline

owenpan created this revision.Aug 15 2023, 4:25 AM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptAug 15 2023, 4:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
owenpan requested review of this revision.Aug 15 2023, 4:25 AM
HazardyKnusperkeks added inline comments.
clang/lib/Format/TokenAnnotator.cpp
3104

Is a bit clearer.

This revision is now accepted and ready to land.Aug 15 2023, 9:26 AM
owenpan added inline comments.Aug 16 2023, 1:42 AM
clang/lib/Format/TokenAnnotator.cpp
3104

I moved this function up to here from below and only removed a couple of consts. I can clean it up in another patch.

owenpan added inline comments.Aug 16 2023, 11:36 AM
clang/lib/Format/TokenAnnotator.cpp
3104

See D158104.

owenpan updated this revision to Diff 551019.Aug 17 2023, 12:29 AM

Rebased to D158104 and simplified getFunctionName and isCtorOrDtorName a little.

This revision was landed with ongoing or failed builds.Aug 24 2023, 1:48 AM
This revision was automatically updated to reflect the committed changes.

@kadircet shouldn't you at least say why it got reverted? Even better state your problem and give a chance to fix before you revert?

@kadircet shouldn't you at least say why it got reverted? Even better state your problem and give a chance to fix before you revert?

Hi, https://reviews.llvm.org/rG7590b7657004b33b1a12b05f8e9174db3e192f8c already has that context.

owenpan added inline comments.Aug 28 2023, 2:35 PM
clang/lib/Format/TokenAnnotator.cpp
3135

When simplifying the function, I forgot that we are in the inner loop here and thus break won't exit the outer loop.

owenpan updated this revision to Diff 554051.Aug 28 2023, 2:38 PM

Fixed the crash and added a test case in TokenAnnotatorTest.cpp.

owenpan reopened this revision.Aug 28 2023, 2:39 PM
This revision is now accepted and ready to land.Aug 28 2023, 2:39 PM
owenpan requested review of this revision.Aug 28 2023, 2:39 PM
This revision is now accepted and ready to land.Aug 29 2023, 12:24 PM