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

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 4 05:05:19 PDT 2021


RKSimon created this revision.
RKSimon added reviewers: ychen, rnk, MaskRay, zturner, chandlerc, lattner.
Herald added subscribers: dexonsmith, hiraditya.
RKSimon requested review of this revision.
Herald added projects: clang, LLVM.
Herald added a subscriber: cfe-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111049

Files:
  clang/tools/clang-repl/ClangRepl.cpp
  clang/tools/driver/cc1_main.cpp
  clang/tools/driver/cc1as_main.cpp
  clang/tools/libclang/FatalErrorHandler.cpp
  llvm/include/llvm/Support/ErrorHandling.h
  llvm/lib/Support/ErrorHandling.cpp
  llvm/tools/llvm-isel-fuzzer/llvm-isel-fuzzer.cpp
  llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111049.376870.patch
Type: text/x-patch
Size: 5297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211004/38bc05cd/attachment-0001.bin>


More information about the cfe-commits mailing list