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 RewriteIncludes : 1; ///< Preprocess include directives only. |
36 | LLVM_PREFERRED_TYPE(bool) |
37 | unsigned RewriteImports : 1; ///< Include contents of transitively-imported modules. |
38 | LLVM_PREFERRED_TYPE(bool) |
39 | unsigned MinimizeWhitespace : 1; ///< Ignore whitespace from input. |
40 | LLVM_PREFERRED_TYPE(bool) |
41 | unsigned DirectivesOnly : 1; ///< Process directives but do not expand macros. |
42 | LLVM_PREFERRED_TYPE(bool) |
43 | unsigned KeepSystemIncludes : 1; ///< Do not expand system headers. |
44 | |
45 | public: |
46 | PreprocessorOutputOptions() { |
47 | ShowCPP = 0; |
48 | ShowComments = 0; |
49 | ShowLineMarkers = 1; |
50 | UseLineDirectives = 0; |
51 | ShowMacroComments = 0; |
52 | ShowMacros = 0; |
53 | ShowIncludeDirectives = 0; |
54 | RewriteIncludes = 0; |
55 | RewriteImports = 0; |
56 | MinimizeWhitespace = 0; |
57 | DirectivesOnly = 0; |
58 | KeepSystemIncludes = 0; |
59 | } |
60 | }; |
61 | |
62 | } // end namespace clang |
63 | |
64 | #endif |
65 |