From: Sam McCall Date: Sat, 7 May 2022 22:50:10 +0000 (+0200) Subject: [Frontend] when attaching a preamble, don't generate the long predefines buffer. X-Git-Tag: upstream/15.0.7~8248 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0195163dbae962ebb48bcba32b6db85919f07370;p=platform%2Fupstream%2Fllvm.git [Frontend] when attaching a preamble, don't generate the long predefines buffer. 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. Differential Revision: https://reviews.llvm.org/D125180 --- diff --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp index d5aab4a..e3c3466 100644 --- a/clang/lib/Frontend/PrecompiledPreamble.cpp +++ b/clang/lib/Frontend/PrecompiledPreamble.cpp @@ -765,6 +765,10 @@ void PrecompiledPreamble::configurePreamble( PreprocessorOpts.DisablePCHOrModuleValidation = DisableValidationForModuleKind::PCH; + // Don't bother generating the long version of the predefines buffer. + // The preamble is going to overwrite it anyway. + PreprocessorOpts.UsePredefines = false; + setupPreambleStorage(*Storage, PreprocessorOpts, VFS); }