• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===--- DependencyOutputOptions.h ------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H
11 #define LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H
12 
13 #include <string>
14 #include <vector>
15 
16 namespace clang {
17 
18 /// DependencyOutputFormat - Format for the compiler dependency file.
19 enum class DependencyOutputFormat { Make, NMake };
20 
21 /// DependencyOutputOptions - Options for controlling the compiler dependency
22 /// file generation.
23 class DependencyOutputOptions {
24 public:
25   unsigned IncludeSystemHeaders : 1; ///< Include system header dependencies.
26   unsigned ShowHeaderIncludes : 1;   ///< Show header inclusions (-H).
27   unsigned UsePhonyTargets : 1;      ///< Include phony targets for each
28                                      /// dependency, which can avoid some 'make'
29                                      /// problems.
30   unsigned AddMissingHeaderDeps : 1; ///< Add missing headers to dependency list
31   unsigned PrintShowIncludes : 1; ///< Print cl.exe style /showIncludes info.
32   unsigned IncludeModuleFiles : 1; ///< Include module file dependencies.
33 
34   /// The format for the dependency file.
35   DependencyOutputFormat OutputFormat;
36 
37   /// The file to write dependency output to.
38   std::string OutputFile;
39 
40   /// The file to write header include output to. This is orthogonal to
41   /// ShowHeaderIncludes (-H) and will include headers mentioned in the
42   /// predefines buffer. If the output file is "-", output will be sent to
43   /// stderr.
44   std::string HeaderIncludeOutputFile;
45 
46   /// A list of names to use as the targets in the dependency file; this list
47   /// must contain at least one entry.
48   std::vector<std::string> Targets;
49 
50   /// A list of filenames to be used as extra dependencies for every target.
51   std::vector<std::string> ExtraDeps;
52 
53   /// In /showIncludes mode, pretend the main TU is a header with this name.
54   std::string ShowIncludesPretendHeader;
55 
56   /// \brief The file to write GraphViz-formatted header dependencies to.
57   std::string DOTOutputFile;
58 
59   /// \brief The directory to copy module dependencies to when collecting them.
60   std::string ModuleDependencyOutputDir;
61 
62 public:
DependencyOutputOptions()63   DependencyOutputOptions() {
64     IncludeSystemHeaders = 0;
65     ShowHeaderIncludes = 0;
66     UsePhonyTargets = 0;
67     AddMissingHeaderDeps = 0;
68     PrintShowIncludes = 0;
69     IncludeModuleFiles = 0;
70     OutputFormat = DependencyOutputFormat::Make;
71   }
72 };
73 
74 }  // end namespace clang
75 
76 #endif
77