[Lldb-commits] [PATCH] Reduce header footprint of Module.h

Zachary Turner zturner at google.com
Mon Mar 2 17:44:15 PST 2015


Hi clayborg, jingham,

This is part of a larger effort to reduce header file footprints.   Locally, I have a working copy of LLDB that builds between 30-40% faster than ToT.  This is done almost entirely by removing header file includes from other headers where they are not needed.  I have focused on the biggest offender, which is the clang headers.  In particular, this and other subsequent patches will attempt to stop #including clang headers from other headers except where absolutely necessary.  The way this happens in practice is that a class needs to store a ClangASTType.  This patch (and the ones that follow) address this by changing by-value inclusion of ClangASTType to an std::unique_ptr<ClangASTType>, and then forward declaring the ClangASTType.

I don't expect this to be too controversial, but I want to throw up this small patch for review first before I take it as a sign that I'm going about this the right way.  You probably won't notice much of a difference in build speed by applying this patch, but taken in conjunction with the rest of the patches, the build speed on my local machine is between 30-40% faster depending on the run, and I wasn't even done yet :)

http://reviews.llvm.org/D8022

Files:
  include/lldb/Core/ArchSpec.h
  include/lldb/Core/Module.h
  include/lldb/lldb-forward.h
  source/API/SBModule.cpp
  source/Core/Module.cpp
  source/Expression/ClangASTSource.cpp
  source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
  source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8022.21069.patch
Type: text/x-patch
Size: 10626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150303/8814838a/attachment.bin>


More information about the lldb-commits mailing list