This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Correctly handle SpaceBeforeParens for builtins.
ClosedPublic

Authored by curdeius on May 6 2022, 2:29 AM.

Details

Summary

That's a partial fix for https://github.com/llvm/llvm-project/issues/55292.

Before, known builtins behaved differently from other identifiers:

void f () { return F (__builtin_LINE() + __builtin_FOO ()); }

After:

void f () { return F (__builtin_LINE () + __builtin_FOO ()); }

Diff Detail

Event Timeline

curdeius created this revision.May 6 2022, 2:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 2:29 AM
curdeius requested review of this revision.May 6 2022, 2:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 2:29 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
owenpan added inline comments.May 6 2022, 8:50 AM
clang/lib/Format/TokenAnnotator.cpp
3439–3441

Any identifiers and keywords are covered now.

curdeius updated this revision to Diff 428009.May 9 2022, 2:04 AM
curdeius marked an inline comment as done.

Address comment: simplify.

owenpan accepted this revision.May 9 2022, 2:15 AM

LGTM

This revision is now accepted and ready to land.May 9 2022, 2:15 AM
This revision was landed with ongoing or failed builds.May 9 2022, 2:42 AM
This revision was automatically updated to reflect the committed changes.