Skip to content

Commit

Permalink
Reduce the number of things in the preprocessor
Browse files Browse the repository at this point in the history
Summary: Avoid creating an entirely empty CPreprocessor. Presumably this will reduce memory, at least a little bit.

Reviewed By: bobyangyf

Differential Revision: D47270017

fbshipit-source-id: eec4d7fef8b60e47462ae7a5ab2be4b46b90f1e4
  • Loading branch information
ndmitchell authored and facebook-github-bot committed Jul 25, 2023
1 parent 3be86c6 commit 6c5efdd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prelude/cxx/cxx.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,12 @@ def prebuilt_cxx_library_impl(ctx: AnalysisContext) -> list["provider"]:
if header_dirs != None:
for x in header_dirs:
args.append(format_system_include_arg(cmd_args(x), compiler_type))
specific_exportd_pre = CPreprocessor(relative_args = CPreprocessorArgs(args = args))
exported_items = [generic_exported_pre]
if args:
exported_items.append(CPreprocessor(relative_args = CPreprocessorArgs(args = args)))
providers.append(cxx_merge_cpreprocessors(
ctx,
[generic_exported_pre, specific_exportd_pre],
exported_items,
inherited_pp_infos,
))

Expand Down

0 comments on commit 6c5efdd

Please sign in to comment.