[clang] 0195163 - [Frontend] when attaching a preamble, don't generate the long predefines buffer.

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Mon May 9 06:56:05 PDT 2022


Author: Sam McCall
Date: 2022-05-09T15:55:32+02:00
New Revision: 0195163dbae962ebb48bcba32b6db85919f07370

URL: https://github.com/llvm/llvm-project/commit/0195163dbae962ebb48bcba32b6db85919f07370
DIFF: https://github.com/llvm/llvm-project/commit/0195163dbae962ebb48bcba32b6db85919f07370.diff

LOG: [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

Added: 
    

Modified: 
    clang/lib/Frontend/PrecompiledPreamble.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/PrecompiledPreamble.cpp b/clang/lib/Frontend/PrecompiledPreamble.cpp
index d5aab4aedadd6..e3c3466550492 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);
 }
 


        


More information about the cfe-commits mailing list