1 //===--- PreprocessorOutputOptions.h ----------------------------*- 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_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H 10 #define LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H 11 12 #include <llvm/Support/Compiler.h> 13 14 namespace clang { 15 16 /// PreprocessorOutputOptions - Options for controlling the C preprocessor 17 /// output (e.g., -E). 18 class PreprocessorOutputOptions { 19 public: 20 LLVM_PREFERRED_TYPE(bool) 21 unsigned ShowCPP : 1; ///< Print normal preprocessed output. 22 LLVM_PREFERRED_TYPE(bool) 23 unsigned ShowComments : 1; ///< Show comments. 24 LLVM_PREFERRED_TYPE(bool) 25 unsigned ShowLineMarkers : 1; ///< Show \#line markers. 26 LLVM_PREFERRED_TYPE(bool) 27 unsigned UseLineDirectives : 1; ///< Use \#line instead of GCC-style \# N. 28 LLVM_PREFERRED_TYPE(bool) 29 unsigned ShowMacroComments : 1; ///< Show comments, even in macros. 30 LLVM_PREFERRED_TYPE(bool) 31 unsigned ShowMacros : 1; ///< Print macro definitions. 32 LLVM_PREFERRED_TYPE(bool) 33 unsigned ShowIncludeDirectives : 1; ///< Print includes, imports etc. within preprocessed output. 34 LLVM_PREFERRED_TYPE(bool) 35 unsigned ShowEmbedDirectives : 1; ///< Print embeds, etc. within preprocessed 36 LLVM_PREFERRED_TYPE(bool) 37 unsigned RewriteIncludes : 1; ///< Preprocess include directives only. 38 LLVM_PREFERRED_TYPE(bool) 39 unsigned RewriteImports : 1; ///< Include contents of transitively-imported modules. 40 LLVM_PREFERRED_TYPE(bool) 41 unsigned MinimizeWhitespace : 1; ///< Ignore whitespace from input. 42 LLVM_PREFERRED_TYPE(bool) 43 unsigned DirectivesOnly : 1; ///< Process directives but do not expand macros. 44 LLVM_PREFERRED_TYPE(bool) 45 unsigned KeepSystemIncludes : 1; ///< Do not expand system headers. 46 47 public: PreprocessorOutputOptions()48 PreprocessorOutputOptions() { 49 ShowCPP = 0; 50 ShowComments = 0; 51 ShowLineMarkers = 1; 52 UseLineDirectives = 0; 53 ShowMacroComments = 0; 54 ShowMacros = 0; 55 ShowIncludeDirectives = 0; 56 ShowEmbedDirectives = 0; 57 RewriteIncludes = 0; 58 RewriteImports = 0; 59 MinimizeWhitespace = 0; 60 DirectivesOnly = 0; 61 KeepSystemIncludes = 0; 62 } 63 }; 64 65 } // end namespace clang 66 67 #endif 68