[PATCH] D69778: Make -fmodules-codegen and -fmodules-debuginfo work also with precompiled headers

Luboš Luňák via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 3 13:33:53 PST 2019


llunak created this revision.
llunak added a reviewer: dblaikie.
llunak added a project: clang.
Herald added a subscriber: cfe-commits.

This patch allows to build PCH's (with -building-pch-with-obj and the extra .o file) with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code into the extra .o file (presumably similarly how modules emit that to wherever they emit it). This saves up to 20% of build time here. I can build pretty much a complete debug build of LibreOffice with this, with just two minor problems (to be sorted out later).

The patch is fairly simple, it basically just duplicates -fmodules checks to also alternatively check -building-pch-with-obj.


Repository:
  rC Clang

https://reviews.llvm.org/D69778

Files:
  clang/lib/Serialization/ASTReader.cpp
  clang/lib/Serialization/ASTReaderDecl.cpp
  clang/lib/Serialization/ASTWriter.cpp
  clang/lib/Serialization/ASTWriterDecl.cpp
  clang/test/Modules/Inputs/codegen-flags/foo.h
  clang/test/PCH/codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69778.227634.patch
Type: text/x-patch
Size: 7483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191103/41013648/attachment.bin>


More information about the cfe-commits mailing list