llvm-project/clang/lib/Frontend/Rewrite
Simon Pilgrim 61cdaf66fe [ADT] Remove APInt/APSInt toString() std::string variants
<string> is currently the highest impact header in a clang+llvm build:

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

One of the most common places this is being included is the APInt.h header, which needs it for an old toString() implementation that returns std::string - an inefficient method compared to the SmallString versions that it actually wraps.

This patch replaces these APInt/APSInt methods with a pair of llvm::toString() helpers inside StringExtras.h, adjusts users accordingly and removes the <string> from APInt.h - I was hoping that more of these users could be converted to use the SmallString methods, but it appears that most end up creating a std::string anyhow. I avoided trying to use the raw_ostream << operators as well as I didn't want to lose having the integer radix explicit in the code.

Differential Revision: https://reviews.llvm.org/D103888
2021-06-11 13:19:15 +01:00
..
CMakeLists.txt [openmp] Base of tablegen generated OpenMP common declaration 2020-06-23 10:32:32 -04:00
FixItRewriter.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
FrontendActions.cpp [Windows] Turn off text mode correctly in Rewriter to stop CRLF translation 2021-04-06 10:49:09 -04:00
HTMLPrint.cpp clang/Frontend: Mostly stop using SourceManager::getBuffer, NFC 2020-10-14 23:31:28 -04:00
InclusionRewriter.cpp Lexer: Update the Lexer to use MemoryBufferRef, NFC 2020-10-19 19:10:21 -04:00
RewriteMacros.cpp Lexer: Update the Lexer to use MemoryBufferRef, NFC 2020-10-19 19:10:21 -04:00
RewriteModernObjC.cpp [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
RewriteObjC.cpp [clang] NFC: Rename rvalue to prvalue 2021-06-09 12:27:10 +02:00
RewriteTest.cpp