clang 17.0.0git
DependencyScanningService.h
Go to the documentation of this file.
1//===- DependencyScanningService.h - clang-scan-deps service ===-*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
10#define LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
11
13
14namespace clang {
15namespace tooling {
16namespace dependencies {
17
18/// The mode in which the dependency scanner will operate to find the
19/// dependencies.
20enum class ScanningMode {
21 /// This mode is used to compute the dependencies by running the preprocessor
22 /// over the source files.
24
25 /// This mode is used to compute the dependencies by running the preprocessor
26 /// with special kind of lexing after scanning header and source files to get
27 /// the minimum necessary preprocessor directives for evaluating includes.
29};
30
31/// The format that is output by the dependency scanner.
33 /// This is the Makefile compatible dep format. This will include all of the
34 /// deps necessary for an implicit modules build, but won't include any
35 /// intermodule dependency information.
36 Make,
37
38 /// This outputs the full clang module dependency graph suitable for use for
39 /// explicitly building modules.
40 Full,
41
42 /// This outputs the dependency graph for standard c++ modules in P1689R5
43 /// format.
44 P1689,
45};
46
47/// The dependency scanning service contains shared configuration and state that
48/// is used by the individual dependency scanning workers.
50public:
52 bool OptimizeArgs = false,
53 bool EagerLoadModules = false);
54
55 ScanningMode getMode() const { return Mode; }
56
57 ScanningOutputFormat getFormat() const { return Format; }
58
59 bool canOptimizeArgs() const { return OptimizeArgs; }
60
61 bool shouldEagerLoadModules() const { return EagerLoadModules; }
62
64 return SharedCache;
65 }
66
67private:
68 const ScanningMode Mode;
69 const ScanningOutputFormat Format;
70 /// Whether to optimize the modules' command-line arguments.
71 const bool OptimizeArgs;
72 /// Whether to set up command-lines to load PCM files eagerly.
73 const bool EagerLoadModules;
74 /// The global file system cache.
76};
77
78} // end namespace dependencies
79} // end namespace tooling
80} // end namespace clang
81
82#endif // LLVM_CLANG_TOOLING_DEPENDENCYSCANNING_DEPENDENCYSCANNINGSERVICE_H
This class is a shared cache, that caches the 'stat' and 'open' calls to the underlying real file sys...
The dependency scanning service contains shared configuration and state that is used by the individua...
DependencyScanningFilesystemSharedCache & getSharedCache()
ScanningOutputFormat
The format that is output by the dependency scanner.
@ Make
This is the Makefile compatible dep format.
@ Full
This outputs the full clang module dependency graph suitable for use for explicitly building modules.
@ P1689
This outputs the dependency graph for standard c++ modules in P1689R5 format.
ScanningMode
The mode in which the dependency scanner will operate to find the dependencies.
@ DependencyDirectivesScan
This mode is used to compute the dependencies by running the preprocessor with special kind of lexing...
@ CanonicalPreprocessing
This mode is used to compute the dependencies by running the preprocessor over the source files.