]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/MC/MCTargetOptions.h
Merge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / MC / MCTargetOptions.h
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
10 #ifndef LLVM_MC_MCTARGETOPTIONS_H
11 #define LLVM_MC_MCTARGETOPTIONS_H
12
13 #include <string>
14 #include <vector>
15
16 namespace llvm {
17
18 enum class ExceptionHandling {
19   None,     /// No exception support
20   DwarfCFI, /// DWARF-like instruction based exceptions
21   SjLj,     /// setjmp/longjmp based exceptions
22   ARM,      /// ARM EHABI
23   WinEH,    /// Windows Exception Handling
24 };
25
26 class StringRef;
27
28 class MCTargetOptions {
29 public:
30   enum AsmInstrumentation {
31     AsmInstrumentationNone,
32     AsmInstrumentationAddress
33   };
34
35   /// Enables AddressSanitizer instrumentation at machine level.
36   bool SanitizeAddress : 1;
37
38   bool MCRelaxAll : 1;
39   bool MCNoExecStack : 1;
40   bool MCFatalWarnings : 1;
41   bool MCNoWarn : 1;
42   bool MCNoDeprecatedWarn : 1;
43   bool MCSaveTempLabels : 1;
44   bool MCUseDwarfDirectory : 1;
45   bool MCIncrementalLinkerCompatible : 1;
46   bool MCPIECopyRelocations : 1;
47   bool ShowMCEncoding : 1;
48   bool ShowMCInst : 1;
49   bool AsmVerbose : 1;
50
51   /// Preserve Comments in Assembly.
52   bool PreserveAsmComments : 1;
53
54   int DwarfVersion;
55
56   /// getABIName - If this returns a non-empty string this represents the
57   /// textual name of the ABI that we want the backend to use, e.g. o32, or
58   /// aapcs-linux.
59   StringRef getABIName() const;
60   std::string ABIName;
61
62   /// Additional paths to search for `.include` directives when using the
63   /// integrated assembler.
64   std::vector<std::string> IASSearchPaths;
65
66   MCTargetOptions();
67 };
68
69 inline bool operator==(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
70 #define ARE_EQUAL(X) LHS.X == RHS.X
71   return (ARE_EQUAL(SanitizeAddress) &&
72           ARE_EQUAL(MCRelaxAll) &&
73           ARE_EQUAL(MCNoExecStack) &&
74           ARE_EQUAL(MCFatalWarnings) &&
75           ARE_EQUAL(MCNoWarn) &&
76           ARE_EQUAL(MCNoDeprecatedWarn) &&
77           ARE_EQUAL(MCSaveTempLabels) &&
78           ARE_EQUAL(MCUseDwarfDirectory) &&
79           ARE_EQUAL(MCIncrementalLinkerCompatible) &&
80           ARE_EQUAL(MCPIECopyRelocations) &&
81           ARE_EQUAL(ShowMCEncoding) &&
82           ARE_EQUAL(ShowMCInst) &&
83           ARE_EQUAL(AsmVerbose) &&
84           ARE_EQUAL(DwarfVersion) &&
85           ARE_EQUAL(ABIName) &&
86           ARE_EQUAL(IASSearchPaths));
87 #undef ARE_EQUAL
88 }
89
90 inline bool operator!=(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
91   return !(LHS == RHS);
92 }
93
94 } // end namespace llvm
95
96 #endif