This is an archive of the discontinued LLVM Phabricator instance.

[Support] Change fatal_error_handler_t to take a const char* instead of std::string
ClosedPublic

Authored by RKSimon on Oct 4 2021, 5:05 AM.

Details

Summary

https://commondatastorage.googleapis.com/chromium-browser-clang/llvm-include-analysis.html

Excessive use of the <string> header has a massive impact on compile time; its most commonly included via the ErrorHandling.h header, which has to be included in many key headers, impacting many source files that have no need for std::string.

As an initial step toward removing the <string> include from ErrorHandling.h, this patch proposes to update the fatal_error_handler_t handler to just take a raw const char* instead.

The next step will be to remove the report_fatal_error std::string variant, which will involve a lot of cleanup and better use of Twine/StringRef.

Diff Detail

Event Timeline

RKSimon created this revision.Oct 4 2021, 5:05 AM
RKSimon requested review of this revision.Oct 4 2021, 5:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 4 2021, 5:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ychen accepted this revision.Oct 4 2021, 10:14 AM

Sounds good to me.

This revision is now accepted and ready to land.Oct 4 2021, 10:14 AM
MaskRay accepted this revision.Oct 4 2021, 5:38 PM
lattner accepted this revision.Oct 4 2021, 9:40 PM

This is really great, thank you for doing this. I'd love to see <string> reduced out of headers!