2
0

MCTargetOptions.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //===- MCTargetOptions.h - MC Target Options -------------------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLVM_MC_MCTARGETOPTIONS_H
  10. #define LLVM_MC_MCTARGETOPTIONS_H
  11. #include <string>
  12. namespace llvm {
  13. class StringRef;
  14. class MCTargetOptions {
  15. public:
  16. enum AsmInstrumentation {
  17. AsmInstrumentationNone,
  18. AsmInstrumentationAddress
  19. };
  20. /// Enables AddressSanitizer instrumentation at machine level.
  21. bool SanitizeAddress : 1;
  22. bool MCRelaxAll : 1;
  23. bool MCNoExecStack : 1;
  24. bool MCFatalWarnings : 1;
  25. bool MCSaveTempLabels : 1;
  26. bool MCUseDwarfDirectory : 1;
  27. bool ShowMCEncoding : 1;
  28. bool ShowMCInst : 1;
  29. bool AsmVerbose : 1;
  30. int DwarfVersion;
  31. /// getABIName - If this returns a non-empty string this represents the
  32. /// textual name of the ABI that we want the backend to use, e.g. o32, or
  33. /// aapcs-linux.
  34. StringRef getABIName() const { // HLSL Change - inline implementation
  35. return ABIName;
  36. }
  37. ::std::string ABIName;
  38. MCTargetOptions() // HLSL Change - inline implementation
  39. : SanitizeAddress(false), MCRelaxAll(false), MCNoExecStack(false),
  40. MCFatalWarnings(false), MCSaveTempLabels(false),
  41. MCUseDwarfDirectory(false), ShowMCEncoding(false), ShowMCInst(false),
  42. AsmVerbose(false), DwarfVersion(0), ABIName() {}
  43. };
  44. inline bool operator==(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
  45. #define ARE_EQUAL(X) LHS.X == RHS.X
  46. return (ARE_EQUAL(SanitizeAddress) &&
  47. ARE_EQUAL(MCRelaxAll) &&
  48. ARE_EQUAL(MCNoExecStack) &&
  49. ARE_EQUAL(MCFatalWarnings) &&
  50. ARE_EQUAL(MCSaveTempLabels) &&
  51. ARE_EQUAL(MCUseDwarfDirectory) &&
  52. ARE_EQUAL(ShowMCEncoding) &&
  53. ARE_EQUAL(ShowMCInst) &&
  54. ARE_EQUAL(AsmVerbose) &&
  55. ARE_EQUAL(DwarfVersion) &&
  56. ARE_EQUAL(ABIName));
  57. #undef ARE_EQUAL
  58. }
  59. inline bool operator!=(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
  60. return !(LHS == RHS);
  61. }
  62. } // end namespace llvm
  63. #endif