Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:55

0001 //===--- DependencyOutputOptions.h ------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H
0010 #define LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H
0011 
0012 #include "clang/Basic/HeaderInclude.h"
0013 #include <string>
0014 #include <vector>
0015 
0016 namespace clang {
0017 
0018 /// ShowIncludesDestination - Destination for /showIncludes output.
0019 enum class ShowIncludesDestination { None, Stdout, Stderr };
0020 
0021 /// DependencyOutputFormat - Format for the compiler dependency file.
0022 enum class DependencyOutputFormat { Make, NMake };
0023 
0024 /// ExtraDepKind - The kind of extra dependency file.
0025 enum ExtraDepKind {
0026   EDK_SanitizeIgnorelist,
0027   EDK_ProfileList,
0028   EDK_ModuleFile,
0029   EDK_DepFileEntry,
0030 };
0031 
0032 /// DependencyOutputOptions - Options for controlling the compiler dependency
0033 /// file generation.
0034 class DependencyOutputOptions {
0035 public:
0036   LLVM_PREFERRED_TYPE(bool)
0037   unsigned IncludeSystemHeaders : 1; ///< Include system header dependencies.
0038   LLVM_PREFERRED_TYPE(bool)
0039   unsigned ShowHeaderIncludes : 1;   ///< Show header inclusions (-H).
0040   LLVM_PREFERRED_TYPE(bool)
0041   unsigned UsePhonyTargets : 1;      ///< Include phony targets for each
0042                                      /// dependency, which can avoid some 'make'
0043                                      /// problems.
0044   LLVM_PREFERRED_TYPE(bool)
0045   unsigned AddMissingHeaderDeps : 1; ///< Add missing headers to dependency list
0046   LLVM_PREFERRED_TYPE(bool)
0047   unsigned IncludeModuleFiles : 1; ///< Include module file dependencies.
0048   LLVM_PREFERRED_TYPE(bool)
0049   unsigned ShowSkippedHeaderIncludes : 1; ///< With ShowHeaderIncludes, show
0050                                           /// also includes that were skipped
0051                                           /// due to the "include guard
0052                                           /// optimization" or #pragma once.
0053 
0054   /// The format of header information.
0055   HeaderIncludeFormatKind HeaderIncludeFormat = HIFMT_Textual;
0056 
0057   /// Determine whether header information should be filtered.
0058   HeaderIncludeFilteringKind HeaderIncludeFiltering = HIFIL_None;
0059 
0060   /// Destination of cl.exe style /showIncludes info.
0061   ShowIncludesDestination ShowIncludesDest = ShowIncludesDestination::None;
0062 
0063   /// The format for the dependency file.
0064   DependencyOutputFormat OutputFormat = DependencyOutputFormat::Make;
0065 
0066   /// The file to write dependency output to.
0067   std::string OutputFile;
0068 
0069   /// The file to write header include output to. This is orthogonal to
0070   /// ShowHeaderIncludes (-H) and will include headers mentioned in the
0071   /// predefines buffer. If the output file is "-", output will be sent to
0072   /// stderr.
0073   std::string HeaderIncludeOutputFile;
0074 
0075   /// A list of names to use as the targets in the dependency file; this list
0076   /// must contain at least one entry.
0077   std::vector<std::string> Targets;
0078 
0079   /// A list of extra dependencies (filename and kind) to be used for every
0080   /// target.
0081   std::vector<std::pair<std::string, ExtraDepKind>> ExtraDeps;
0082 
0083   /// The file to write GraphViz-formatted header dependencies to.
0084   std::string DOTOutputFile;
0085 
0086   /// The directory to copy module dependencies to when collecting them.
0087   std::string ModuleDependencyOutputDir;
0088 
0089 public:
0090   DependencyOutputOptions()
0091       : IncludeSystemHeaders(0), ShowHeaderIncludes(0), UsePhonyTargets(0),
0092         AddMissingHeaderDeps(0), IncludeModuleFiles(0),
0093         ShowSkippedHeaderIncludes(0), HeaderIncludeFormat(HIFMT_Textual),
0094         HeaderIncludeFiltering(HIFIL_None) {}
0095 };
0096 
0097 }  // end namespace clang
0098 
0099 #endif