PreprocessorOutputOptions.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- PreprocessorOutputOptions.h ----------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H
  14. #define LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H
  15. namespace clang {
  16. /// PreprocessorOutputOptions - Options for controlling the C preprocessor
  17. /// output (e.g., -E).
  18. class PreprocessorOutputOptions {
  19. public:
  20. unsigned ShowCPP : 1; ///< Print normal preprocessed output.
  21. unsigned ShowComments : 1; ///< Show comments.
  22. unsigned ShowLineMarkers : 1; ///< Show \#line markers.
  23. unsigned UseLineDirectives : 1; ///< Use \#line instead of GCC-style \# N.
  24. unsigned ShowMacroComments : 1; ///< Show comments, even in macros.
  25. unsigned ShowMacros : 1; ///< Print macro definitions.
  26. unsigned ShowIncludeDirectives : 1; ///< Print includes, imports etc. within preprocessed output.
  27. unsigned RewriteIncludes : 1; ///< Preprocess include directives only.
  28. unsigned RewriteImports : 1; ///< Include contents of transitively-imported modules.
  29. unsigned MinimizeWhitespace : 1; ///< Ignore whitespace from input.
  30. unsigned DirectivesOnly : 1; ///< Process directives but do not expand macros.
  31. public:
  32. PreprocessorOutputOptions() {
  33. ShowCPP = 0;
  34. ShowComments = 0;
  35. ShowLineMarkers = 1;
  36. UseLineDirectives = 0;
  37. ShowMacroComments = 0;
  38. ShowMacros = 0;
  39. ShowIncludeDirectives = 0;
  40. RewriteIncludes = 0;
  41. RewriteImports = 0;
  42. MinimizeWhitespace = 0;
  43. DirectivesOnly = 0;
  44. }
  45. };
  46. } // end namespace clang
  47. #endif
  48. #ifdef __GNUC__
  49. #pragma GCC diagnostic pop
  50. #endif