[all-commits] [llvm/llvm-project] 407a2f: [clang] Move state out of `PreprocessorOptions` (1...

Jan Svoboda via All-commits all-commits at lists.llvm.org
Fri Mar 29 11:21:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 407a2f231a81862e20d80059870c48d818b61ec2
      https://github.com/llvm/llvm-project/commit/407a2f231a81862e20d80059870c48d818b61ec2
  Author: Jan Svoboda <jan_svoboda at apple.com>
  Date:   2024-03-29 (Fri, 29 Mar 2024)

  Changed paths:
    M clang/include/clang/Frontend/FrontendActions.h
    M clang/include/clang/Lex/Preprocessor.h
    M clang/include/clang/Lex/PreprocessorOptions.h
    M clang/lib/Frontend/FrontendActions.cpp
    M clang/lib/Lex/PPLexerChange.cpp
    M clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
    M clang/unittests/Lex/PPDependencyDirectivesTest.cpp

  Log Message:
  -----------
  [clang] Move state out of `PreprocessorOptions` (1/n) (#86358)

An instance of `PreprocessorOptions` is part of `CompilerInvocation`
which is supposed to be a value type. The `DependencyDirectivesForFile`
member is problematic, since it holds an owning reference of the
scanning VFS. This makes it not a true value type, and it can keep
potentially large chunk of memory (the local cache in the scanning VFS)
alive for longer than clients might expect. Let's move it into the
`Preprocessor` instead.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list