Closed Bug 2065729 Opened 2 months ago Closed 2 months ago

Use std::source_location in CheckedUnsafePtr

Categories

(Core :: Storage: Quota Manager, task)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: jstutte, Assigned: jstutte)

References

Details

Attachments

(1 external file, 1 obsolete file)

Bug 2069184 moved the Linux build sysroot to libstdc++ 11, so std::source_location is available on every toolchain we build with and the MFBT shim is not needed anymore. D320652 is abandoned.

Repurposing this bug for the CheckedUnsafePtr conversion alone. The WebrtcLocation conversion stays on bug 1973646 and the ClearOnShutdown marker on bug 2065730; both now use std::source_location directly and no longer depend on this bug.

Blocks: 2065730

Two places in the tree hand roll the same __has_builtin guards around
__builtin_FUNCTION, __builtin_FILE and __builtin_LINE to capture a caller's
location as a default argument, and a third was about to.

std::source_location is the spelling we want but the Linux build sysroot still
ships libstdc++ 10, which only has the TS version. That one is implemented with
the very same builtins, so use it where the real header is missing and let the
shim collapse to a plain using declaration once the sysroot moves on.

libc++ has neither header before version 15. We do not build that ourselves but
downstream ports do, and both existing consumers degraded gracefully rather
than failing to build, so keep a dummy fallback for them.

Assignee: nobody → jstutte
Status: NEW → ASSIGNED

The bt_function/bt_file/bt_line macros here are the same __has_builtin dance the
shim now does once. They were also never undefined, so three very generic names
leaked into every translation unit including this header.

Blocks: 1973646
Attachment #9629707 - Attachment description: Bug 2065729 - Add a std::source_location shim to MFBT. r?nika → Bug 2065729 - Add a C++ source location shim to MFBT. r?nika,glandium
Attachment #9629708 - Attachment description: Bug 2065729 - Use the MFBT source_location shim in CheckedUnsafePtr. r?#dom-storage-reviewers → Bug 2065729 - Use the MFBT CxxSourceLocation shim in CheckedUnsafePtr. r?#dom-storage-reviewers
Attachment #9629707 - Attachment is obsolete: true
No longer blocks: 1973646, 2065730
Component: MFBT → Storage: Quota Manager
Depends on: 2069184
See Also: → 1973646
Summary: Add a std::source_location shim to MFBT and use it for the hand-rolled location builtins → Use std::source_location in CheckedUnsafePtr
Attachment #9629708 - Attachment description: Bug 2065729 - Use the MFBT CxxSourceLocation shim in CheckedUnsafePtr. r?#dom-storage-reviewers → Bug 2065729 - Use std::source_location in CheckedUnsafePtr. r?#dom-storage-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
QA Whiteboard: [qa-triage-done-c159/b158]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: