[clang] [clang] Move state out of `PreprocessorOptions` (1/n) (PR #86358)

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 28 13:55:45 PDT 2024


================
@@ -736,6 +736,19 @@ class Preprocessor {
     State ConditionalStackState = Off;
   } PreambleConditionalStack;
 
+  /// Function for getting the dependency preprocessor directives of a file.
+  ///
+  /// These are directives derived from a special form of lexing where the
+  /// source input is scanned for the preprocessor directives that might have an
+  /// effect on the dependencies for a compilation unit.
+  ///
+  /// Enables a client to cache the directives for a file and provide them
+  /// across multiple compiler invocations.
+  /// FIXME: Allow returning an error.
+  using DependencyDirectivesFn = std::function<std::optional<
----------------
benlangmuir wrote:

I know you're just moving this, but can we make this `llvm::unique_function`? I don't think we ever need to copy it

https://github.com/llvm/llvm-project/pull/86358


More information about the cfe-commits mailing list