[PATCH] D153229: [llvm] Move StringExtras.h include from Error.h to Error.cpp
Elliot Goodrich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 18 10:56:42 PDT 2023
IncludeGuardian created this revision.
Herald added subscribers: bviyer, luke, Moerafaat, kmitropoulou, zero9178, steakhal, mtrofin, bzcheeseman, mattd, gchakrabarti, pmatos, asb, sdasgup3, asavonic, jeroen.dobbelaere, wenzhicui, wrengr, ormris, foad, ChuanqiXu, cota, teijeong, frasercrmck, rdzhabarov, tatianashp, okura, jdoerfert, msifontes, jurahul, kuter, Kayjukh, grosul1, martong, Joonsoo, kerbowa, liufengdb, aartbik, mgester, arpith-jacob, csigg, antiagainst, shauheen, rriddle, mehdi_amini, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, asbirlea, thopre, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, kbarton, hiraditya, arichardson, sbc100, jvesely, nemanjai, arsenm.
Herald added a reviewer: alexander-shaposhnikov.
Herald added a reviewer: jhenderson.
Herald added a reviewer: NoQ.
Herald added a project: All.
IncludeGuardian requested review of this revision.
Herald added subscribers: llvm-commits, cfe-commits, wangpc, stephenneuendorffer, nicolasvasilache, MaskRay, aheejin, jholewinski.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added projects: clang, MLIR, LLVM.
Move the implementation of the `toString` function from `llvm/Support/Error.h` to the source file,
which allows us to move `#include "llvm/ADT/StringExtras.h"` to the source file as well.
As `Error.h` is present in a large number of translation units this means we are unnecessarily bringing in the
contents of `StringExtras.h` - itself a large file with lots of includes - and slowing down compilation.
Includes have been added to source/header files that are needed but were being transitively included. The
majority needed `StringExtras.h` but a few only required a smaller header: `APInt.h`, `APSInt.h`, or
`SmallString.h`.
This reduces the total number of preprocessing tokens across the LLVM source files in lib from (roughly)
1,920,413,050 to 1,903,629,230 - a reduction of ~0.87%. This should result in a small improvement in compilation
time.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D153229
Files:
clang/include/clang/ASTMatchers/ASTMatchers.h
clang/lib/AST/ExprConstant.cpp
clang/lib/AST/JSONNodeDumper.cpp
clang/lib/Basic/Sarif.cpp
clang/lib/Driver/Job.cpp
clang/lib/Driver/ToolChains/AIX.cpp
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/lib/Sema/SemaCast.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaInit.cpp
clang/lib/Sema/SemaModule.cpp
clang/lib/Sema/SemaStmt.cpp
clang/lib/Sema/SemaStmtAsm.cpp
clang/lib/Sema/SemaTemplateInstantiate.cpp
clang/lib/Sema/SemaType.cpp
clang/lib/StaticAnalyzer/Core/CheckerContext.cpp
clang/tools/clang-offload-packager/ClangOffloadPackager.cpp
clang/tools/driver/cc1as_main.cpp
llvm/include/llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h
llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
llvm/include/llvm/DebugInfo/GSYM/FunctionInfo.h
llvm/include/llvm/Debuginfod/HTTPClient.h
llvm/include/llvm/ProfileData/GCOV.h
llvm/include/llvm/Support/Error.h
llvm/lib/Analysis/AliasSetTracker.cpp
llvm/lib/Analysis/CallGraphSCCPass.cpp
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/ScalarEvolution.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
llvm/lib/CodeGen/MachineBasicBlock.cpp
llvm/lib/CodeGen/MachineCheckDebugify.cpp
llvm/lib/CodeGen/RegisterBankInfo.cpp
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/lib/DWARFLinker/DWARFLinkerCompileUnit.cpp
llvm/lib/DWARFLinkerParallel/DWARFLinkerUnit.h
llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp
llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp
llvm/lib/DebugInfo/PDB/Native/InputFile.cpp
llvm/lib/DebugInfo/PDB/Native/NativeEnumInjectedSources.cpp
llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
llvm/lib/DebugInfo/PDB/Native/NativeSourceFile.cpp
llvm/lib/DebugInfo/PDB/Native/PDBFileBuilder.cpp
llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
llvm/lib/FileCheck/FileCheck.cpp
llvm/lib/IR/DIBuilder.cpp
llvm/lib/MC/ELFObjectWriter.cpp
llvm/lib/MC/MCAsmInfo.cpp
llvm/lib/MC/MCParser/ELFAsmParser.cpp
llvm/lib/MC/MCParser/WasmAsmParser.cpp
llvm/lib/ObjCopy/COFF/COFFObjcopy.cpp
llvm/lib/Object/Decompressor.cpp
llvm/lib/Object/ELF.cpp
llvm/lib/ProfileData/Coverage/CoverageMappingWriter.cpp
llvm/lib/Remarks/YAMLRemarkParser.cpp
llvm/lib/Support/BinaryStreamWriter.cpp
llvm/lib/Support/DataExtractor.cpp
llvm/lib/Support/Error.cpp
llvm/lib/Support/JSON.cpp
llvm/lib/Support/Path.cpp
llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp
llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.h
llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp
llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp
llvm/lib/Target/NVPTX/NVPTXCtorDtorLowering.cpp
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
llvm/lib/Target/X86/X86MCInstLower.cpp
llvm/lib/Target/X86/X86PreAMXConfig.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/tools/llvm-cov/CoverageReport.cpp
llvm/tools/llvm-debuginfod-find/llvm-debuginfod-find.cpp
llvm/tools/llvm-objcopy/ObjcopyOptions.cpp
llvm/tools/llvm-opt-report/OptReport.cpp
llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
llvm/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
llvm/tools/llvm-pdbutil/MinimalTypeDumper.cpp
llvm/tools/llvm-pdbutil/PrettyCompilandDumper.cpp
llvm/tools/llvm-rc/ResourceScriptParser.cpp
llvm/tools/llvm-strings/llvm-strings.cpp
llvm/tools/llvm-tapi-diff/DiffEngine.cpp
mlir/lib/Tools/lsp-server-support/Protocol.cpp
mlir/lib/Tools/lsp-server-support/SourceMgrUtils.cpp
mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153229.532482.patch
Type: text/x-patch
Size: 46789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230618/bdb24cbf/attachment-0001.bin>
More information about the cfe-commits
mailing list