llvm-project/clang/lib/Lex
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 Add clang source minimizer that reduces source to directives 2019-06-03 22:59:17 +00:00
DependencyDirectivesSourceMinimizer.cpp Add support for #elifdef and #elifndef 2021-05-27 08:57:47 -04:00
HeaderMap.cpp [clang][clangd] Use reverse header map lookup in suggestPathToFileForDiagnostics 2021-06-03 01:37:55 -07:00
HeaderSearch.cpp [clang][clangd] Use reverse header map lookup in suggestPathToFileForDiagnostics 2021-06-03 01:37:55 -07:00
Lexer.cpp Add support for #elifdef and #elifndef 2021-05-27 08:57:47 -04:00
LiteralSupport.cpp [C++2b] Support size_t literals 2021-03-31 13:36:23 +00:00
MacroArgs.cpp Remove cache for macro arg stringization 2019-07-30 17:58:22 +00:00
MacroInfo.cpp
ModuleMap.cpp [clang][modules] Build inferred modules 2021-05-17 10:40:51 +02:00
PPCaching.cpp [Lex] Allow to consume tokens while preprocessing 2019-05-17 09:32:05 +00:00
PPCallbacks.cpp Avoid including FileManager.h from SourceManager.h 2020-03-11 13:53:12 -07:00
PPConditionalDirectiveRecord.cpp Add support for #elifdef and #elifndef 2021-05-27 08:57:47 -04:00
PPDirectives.cpp Fix a git apply that went bad somehow. 2021-06-01 14:06:39 -04:00
PPExpressions.cpp [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
PPLexerChange.cpp Lexer: Update the Lexer to use MemoryBufferRef, NFC 2020-10-19 19:10:21 -04:00
PPMacroExpansion.cpp [clang] Fix for "Bug 27113 - MSVC-compat __identifier implementation incomplete" 2021-05-21 11:14:01 +02:00
Pragma.cpp Improve module dumping for debugging. 2021-03-22 19:07:46 -07:00
PreprocessingRecord.cpp Add support for #elifdef and #elifndef 2021-05-27 08:57:47 -04:00
Preprocessor.cpp Add support for #elifdef and #elifndef 2021-05-27 08:57:47 -04:00
PreprocessorLexer.cpp
ScratchBuffer.cpp SourceManager: Make LastLineNoContentCache and ContentCache::SourceLineCache mutable, NFC 2020-10-23 13:22:47 -04:00
TokenConcatenation.cpp C++2a -> C++20 in some identifiers; NFC. 2020-04-21 15:37:19 -04:00
TokenLexer.cpp Revert "Suppress non-conforming GNU paste extension in all standard-conforming modes" 2021-01-27 10:59:57 -08:00
UnicodeCharSets.h clang: Fix typo in comment 2019-08-21 15:41:29 +00:00