clang  9.0.0
DependencyScanningWorker.h
Go to the documentation of this file.
1 //===- DependencyScanningWorker.h - clang-scan-deps worker ===---*- 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_DEPENDENCY_SCANNING_WORKER_H
10 #define LLVM_CLANG_TOOLING_DEPENDENCY_SCANNING_WORKER_H
11 
13 #include "clang/Basic/LLVM.h"
16 #include "llvm/Support/Error.h"
17 #include "llvm/Support/FileSystem.h"
18 #include <string>
19 
20 namespace clang {
21 namespace tooling {
22 namespace dependencies {
23 
24 /// An individual dependency scanning worker that is able to run on its own
25 /// thread.
26 ///
27 /// The worker computes the dependencies for the input files by preprocessing
28 /// sources either using a fast mode where the source files are minimized, or
29 /// using the regular processing run.
31 public:
33 
34  /// Print out the dependency information into a string using the dependency
35  /// file format that is specified in the options (-MD is the default) and
36  /// return it.
37  ///
38  /// \returns A \c StringError with the diagnostic output if clang errors
39  /// occurred, dependency file contents otherwise.
40  llvm::Expected<std::string> getDependencyFile(const std::string &Input,
41  StringRef WorkingDirectory,
42  const CompilationDatabase &CDB);
43 
44 private:
46  std::shared_ptr<PCHContainerOperations> PCHContainerOps;
47 
48  /// The file system that is used by each worker when scanning for
49  /// dependencies. This filesystem persists accross multiple compiler
50  /// invocations.
52 };
53 
54 } // end namespace dependencies
55 } // end namespace tooling
56 } // end namespace clang
57 
58 #endif // LLVM_CLANG_TOOLING_DEPENDENCY_SCANNING_WORKER_H
llvm::Expected< std::string > getDependencyFile(const std::string &Input, StringRef WorkingDirectory, const CompilationDatabase &CDB)
Print out the dependency information into a string using the dependency file format that is specified...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Interface for compilation databases.
An individual dependency scanning worker that is able to run on its own thread.
Dataflow Directional Tag Classes.