Use uppercase names for high-order macros to please clang-format

RESOLVED FIXED in Firefox -esr60

Status

defect
RESOLVED FIXED
8 months ago
7 months ago

People

(Reporter: tcampbell, Assigned: tcampbell)

Tracking

(Blocks 1 bug)

unspecified
mozilla65
Dependency tree / graph

Firefox Tracking Flags

(firefox-esr60 fixed, firefox65 fixed)

Details

Attachments

(8 attachments, 3 obsolete attachments)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
5.47 KB, patch
Details | Diff | Splinter Review
5.13 KB, patch
Details | Diff | Splinter Review
221.31 KB, patch
Details | Diff | Splinter Review
One pattern of failures I see is when using function-like macros that do no use uppercase names or trailing semi-colons.

Examples:
https://github.com/sylvestre/gecko-dev/blob/master/mfbt/RecordReplay.h#L399
https://github.com/sylvestre/gecko-dev/blob/master/js/src/frontend/ParseNode.h#L526

I have a few patches which simply change casing to significantly improve the clang-format result without needing to |clang-format off|.
Blocks: 1508064
This pleases clang-format and makes many of these behave better when
auto formatted. Special cases may still be marked |clang-format off| in
later commits.
Use uppercase names for MOZ_MAKERECORDREPLAYWRAPPER* so that
clang-format doesn't get confused and think these are return value types
of functions.

Depends on D12232
This makes clang-format stop mangling the macros.

Depends on D12233
These changes should only change casing and all other naming and formatting is untouched.
Try in progress: https://treeherder.mozilla.org/#/jobs?repo=try&revision=70accb1a4b0e104551319f5c79539a9bdde22721
Updated js/ patch to fix various python scripts that were using regex to find |macro|.
New try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=882ecb7ff7b13ba6d1f9c67f26f7a458218b59bd
Landing part 1 immediately to avoid it rotting.
Keywords: leave-open
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c8dd8f4166c9
Use uppercase names for high-order macros in js/ r=jandem
Pushed by tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b020ea6c58e5
Use uppercase names for high-order macros in dom/ r=mccr8
https://hg.mozilla.org/integration/autoland/rev/b4ac72eabda0
Use uppercase macro names in mfbt/RecordReplay.h r=bhackett
https://hg.mozilla.org/integration/autoland/rev/ffed3e597810
Use uppercase high-order macro names in xptinfo. r=nika
https://hg.mozilla.org/integration/autoland/rev/0c683a3e80d8
Use uppercase high-order macro names in profiler. r=mstange
Status: NEW → RESOLVED
Closed: 8 months ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Blocks: 1508062
Posted patch ESR patch (part 1) (obsolete) — Splinter Review
[ESR Uplift Approval Request]

If this is not a sec:{high,crit} bug, please state case for ESR consideration: This is required for easier backporting of patches after the reformatting of ESR using clang-format.

User impact if declined: Declining this will negatively impact our developers' ability to easily backport their patches to ESR in the future.

Fix Landed on Version: 65

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): This just changes the case of the names used in a C++ macro, virtually risk free.

String or UUID changes made by this patch: None
Attachment #9030981 - Flags: approval-mozilla-esr60?
Posted patch ESR patch (part 2) (obsolete) — Splinter Review
Please see comment 12.
Attachment #9030982 - Flags: approval-mozilla-esr60?
Attachment #9030983 - Flags: approval-mozilla-esr60?
Attachment #9030984 - Flags: approval-mozilla-esr60?
Posted patch ESR patch (part 5) (obsolete) — Splinter Review
Attachment #9030985 - Flags: approval-mozilla-esr60?
Please see comment 12.
Attachment #9030981 - Attachment is obsolete: true
Attachment #9030981 - Flags: approval-mozilla-esr60?
Attachment #9030989 - Flags: approval-mozilla-esr60?
Comment on attachment 9030989 [details] [diff] [review]
ESR patch (part 1)

OK for uplift to ESR60 as part of the clang-format project.
Attachment #9030989 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Attachment #9030985 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Attachment #9030984 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Attachment #9030983 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Attachment #9030982 - Flags: approval-mozilla-esr60? → approval-mozilla-esr60+
Attachment #9030982 - Attachment is obsolete: true
Attachment #9030985 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.