This is an archive of the discontinued LLVM Phabricator instance.

TEST: Remove <iomanip> from gtest
Needs ReviewPublic

Authored by IncludeGuardian on Aug 3 2023, 1:04 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is an experimental commit to see whether any unit tests are transitively
depending on the #include <iomanip> directive from GoogleTest.

This include is responsible for ~0.45% of the preprocessing directives within
the LLVM project. From the C++ Compile Health Watchdog
we can see that this include adds 100-200ms of total compile time (20-30ms
preprocessing time).

This is now one of the single most expensive includes in LLVM.

Diff Detail

Event Timeline

IncludeGuardian created this revision.Aug 3 2023, 1:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 1:04 PM
IncludeGuardian requested review of this revision.Aug 3 2023, 1:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 1:04 PM
IncludeGuardian added inline comments.Aug 3 2023, 1:06 PM
third-party/unittest/googletest/include/gtest/gtest.h
1739–1745

Here this code is no longer correct after this change. But it's possible to move the setprecision call into the source file and not need a public include of <iomanip>. Here I have removed it since I don't have access to the source file of GoogleTest in LLVM and this is only a proof that the include is not needed anywhere else.