MCTargetOptions.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- MCTargetOptions.h - MC Target Options --------------------*- 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_MC_MCTARGETOPTIONS_H
  14. #define LLVM_MC_MCTARGETOPTIONS_H
  15. #include "llvm/ADT/ArrayRef.h"
  16. #include <string>
  17. #include <vector>
  18. namespace llvm {
  19. enum class ExceptionHandling {
  20. None, ///< No exception support
  21. DwarfCFI, ///< DWARF-like instruction based exceptions
  22. SjLj, ///< setjmp/longjmp based exceptions
  23. ARM, ///< ARM EHABI
  24. WinEH, ///< Windows Exception Handling
  25. Wasm, ///< WebAssembly Exception Handling
  26. AIX, ///< AIX Exception Handling
  27. };
  28. enum class DebugCompressionType {
  29. None, ///< No compression
  30. GNU, ///< zlib-gnu style compression
  31. Z, ///< zlib style complession
  32. };
  33. class StringRef;
  34. class MCTargetOptions {
  35. public:
  36. enum AsmInstrumentation {
  37. AsmInstrumentationNone,
  38. AsmInstrumentationAddress
  39. };
  40. bool MCRelaxAll : 1;
  41. bool MCNoExecStack : 1;
  42. bool MCFatalWarnings : 1;
  43. bool MCNoWarn : 1;
  44. bool MCNoDeprecatedWarn : 1;
  45. bool MCNoTypeCheck : 1;
  46. bool MCSaveTempLabels : 1;
  47. bool MCUseDwarfDirectory : 1;
  48. bool MCIncrementalLinkerCompatible : 1;
  49. bool ShowMCEncoding : 1;
  50. bool ShowMCInst : 1;
  51. bool AsmVerbose : 1;
  52. /// Preserve Comments in Assembly.
  53. bool PreserveAsmComments : 1;
  54. bool Dwarf64 : 1;
  55. int DwarfVersion = 0;
  56. std::string ABIName;
  57. std::string AssemblyLanguage;
  58. std::string SplitDwarfFile;
  59. const char *Argv0 = nullptr;
  60. ArrayRef<std::string> CommandLineArgs;
  61. /// Additional paths to search for `.include` directives when using the
  62. /// integrated assembler.
  63. std::vector<std::string> IASSearchPaths;
  64. MCTargetOptions();
  65. /// getABIName - If this returns a non-empty string this represents the
  66. /// textual name of the ABI that we want the backend to use, e.g. o32, or
  67. /// aapcs-linux.
  68. StringRef getABIName() const;
  69. /// getAssemblyLanguage - If this returns a non-empty string this represents
  70. /// the textual name of the assembly language that we will use for this
  71. /// target, e.g. masm.
  72. StringRef getAssemblyLanguage() const;
  73. };
  74. } // end namespace llvm
  75. #endif // LLVM_MC_MCTARGETOPTIONS_H
  76. #ifdef __GNUC__
  77. #pragma GCC diagnostic pop
  78. #endif