llvm-project/clang/lib/Analysis
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
..
plugins [analyzer][NFC] Change LangOptions to CheckerManager in the shouldRegister* functions 2020-03-27 14:34:09 +01:00
AnalysisDeclContext.cpp AnalysisDeclContext::ManagedAnalyses: Use unique_ptr to simplify memory management 2020-04-28 22:31:16 -07:00
BodyFarm.cpp [clang] NFC: Rename rvalue to prvalue 2021-06-09 12:27:10 +02:00
CFG.cpp [analyzer] Correctly propagate ConstructionContextLayer thru ParenExpr 2021-05-24 10:16:52 +02:00
CFGReachabilityAnalysis.cpp
CFGStmtMap.cpp
CMakeLists.txt [analyzer] Introduce MacroExpansionContext to libAnalysis 2021-02-22 11:11:57 +01:00
CallGraph.cpp [[Clang CallGraph]] CallGraph should still record calls to decls. 2020-03-20 08:55:23 -07:00
CalledOnceCheck.cpp [-Wcompletion-handler] Don't recognize init methods as conventional 2021-04-07 13:50:01 +03:00
CloneDetection.cpp Avoid SourceManager.h include in RawCommentList.h, add missing incs 2020-02-27 13:49:40 -08:00
CocoaConventions.cpp [analyzer] Fix more analyzer warnings on analyzer and libAnalysis. 2019-08-28 21:19:58 +00:00
CodeInjector.cpp
ConstructionContext.cpp
Consumed.cpp [NFC] Refactor representation of materialized temporaries 2019-11-19 18:20:45 +01:00
Dominators.cpp
ExprMutationAnalyzer.cpp [ASTImporter] Add support for importing GenericSelectionExpr AST nodes. 2020-12-16 15:39:50 -08:00
IssueHash.cpp Revert "Revert "[analyzer] NFC: Move IssueHash to libAnalysis."" 2020-11-17 16:01:49 -08:00
LiveVariables.cpp [analyzer][Liveness][NFC] Remove an unneeded pass to collect variables that appear in an assignment 2021-02-12 16:19:20 +01:00
MacroExpansionContext.cpp [MacroExpansionContext] Fix a warning. 2021-02-22 16:54:57 -08:00
ObjCNoReturn.cpp
PathDiagnostic.cpp Add type information to integral template argument if required. 2021-05-12 19:00:08 +00:00
PostOrderCFGView.cpp AnalysisDeclContext::ManagedAnalyses: Use unique_ptr to simplify memory management 2020-04-28 22:31:16 -07:00
ProgramPoint.cpp [AST] Remove DeclCXX.h dep on ASTContext.h 2020-04-06 10:09:01 -07:00
ReachableCode.cpp Change while to do-while 2020-06-25 09:30:30 -07:00
RetainSummaryManager.cpp [analyzer] RetainCountChecker: Disable reference counting for OSMetaClass. 2021-05-27 13:12:19 -07:00
ThreadSafety.cpp [clang] NFC: Rename rvalue to prvalue 2021-06-09 12:27:10 +02:00
ThreadSafetyCommon.cpp [ADT] Remove APInt/APSInt toString() std::string variants 2021-06-11 13:19:15 +01:00
ThreadSafetyLogical.cpp
ThreadSafetyTIL.cpp
UninitializedValues.cpp [SemaCXX] Fix false positive of -Wuninitialized-const-reference in empty function body. 2020-07-06 10:52:05 -07:00