[PATCH] D125180: [Frontend] when attaching a preamble, don't generate the long predefines buffer.
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat May 7 15:50:39 PDT 2022
sammccall created this revision.
sammccall added a reviewer: kadircet.
Herald added a project: All.
sammccall requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
We know we're going to overwrite it anyway.
It'd be a bit of work to coordinate not generating it at all, but setting this
flag avoids generating ~10k of the 13k string.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D125180
Files:
clang/lib/Frontend/PrecompiledPreamble.cpp
Index: clang/lib/Frontend/PrecompiledPreamble.cpp
===================================================================
--- clang/lib/Frontend/PrecompiledPreamble.cpp
+++ clang/lib/Frontend/PrecompiledPreamble.cpp
@@ -765,6 +765,10 @@
PreprocessorOpts.DisablePCHOrModuleValidation =
DisableValidationForModuleKind::PCH;
+ // So don't bother generating the long version of the predefines buffer.
+ // The is going to overwrite it anyway (to almost nothing).
+ PreprocessorOpts.UsePredefines = false;
+
setupPreambleStorage(*Storage, PreprocessorOpts, VFS);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125180.427902.patch
Type: text/x-patch
Size: 577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220507/765c0f5f/attachment.bin>
More information about the cfe-commits
mailing list