This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Granularize most cmath includes
Needs ReviewPublic

Authored by philnik on Aug 2 2023, 11:48 AM.

Details

Reviewers
None
Group Reviewers
Restricted Project

Diff Detail

Event Timeline

philnik created this revision.Aug 2 2023, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 11:48 AM
philnik requested review of this revision.Aug 2 2023, 11:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 11:48 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

As discussed just now, I would like to understand the concrete benefit for doing this granularization. Usually, granularizing headers that are higher in the stack helps with disentangling include cycles. This is not the case here since <cmath> is basically its own little "submodule". Do we get any compile-time benefit when we disable transitive includes?

If we could e.g. run the test suite with transitive includes disabled and show that this change makes a difference, that would be some motivation to make this change. Otherwise, I must say I am skeptical of the benefit of splitting up a header that was as "simple" as this (I mean with few other dependencies).