[Lldb-commits] [PATCH] D155178: [Support] Move StringExtras.h include from Error.h to Error.cpp (part 6)
Elliot Goodrich via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 13 04:32:02 PDT 2023
IncludeGuardian created this revision.
IncludeGuardian added a reviewer: MaskRay.
Herald added a subscriber: hiraditya.
Herald added a project: All.
IncludeGuardian requested review of this revision.
Herald added projects: LLDB, LLVM.
Herald added subscribers: llvm-commits, lldb-commits.
**1st commit**
[lldb] Add missing StringExtras.h includes
In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing includes that were previously included transitively
through this header.
This is fixing all files missed in b0abd4893fa1 <https://reviews.llvm.org/rGb0abd4893fa1bfae7f71b6b6e98770c9b1c07620>, 39d8e6e22cd1 <https://reviews.llvm.org/rG39d8e6e22cd192db6ace37a4c842265058dcddb8>,
a11efd49266f <https://reviews.llvm.org/rGa11efd49266f6cf2a98bdf52428b0c9423158846>, 5551657b310b <https://reviews.llvm.org/rG5551657b310b0f5f97b26288f87bc41a8050bf93>, and 90bfe2df25e7 <https://reviews.llvm.org/rG90bfe2df25e7eed4f3af33623ad26a028d94cef9>.
---
**2nd commit**
[Support] Move StringExtras.h include from Error.h to Error.cpp
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.
Also move the `#include "llvm/ADT/SmallVector.h"` directive to the
source file as it's no longer needed, but this does not give as much of
a benefit.
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/D155178
Files:
lldb/unittests/Symbol/PostfixExpressionTest.cpp
lldb/unittests/SymbolFile/NativePDB/UdtRecordCompleterTests.cpp
llvm/include/llvm/Support/Error.h
llvm/lib/Support/Error.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155178.539953.patch
Type: text/x-patch
Size: 4920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230713/02943184/attachment-0001.bin>
More information about the lldb-commits
mailing list