1 //===- MCTargetOptions.h - MC Target Options --------------------*- 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_MC_MCTARGETOPTIONS_H
10 #define LLVM_MC_MCTARGETOPTIONS_H
11 
12 #include "llvm/ADT/ArrayRef.h"
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   Wasm,     ///< WebAssembly Exception Handling
25   AIX,      ///< AIX Exception Handling
26 };
27 
28 enum class DebugCompressionType {
29   None, ///< No compression
30   GNU,  ///< zlib-gnu style compression
31   Z,    ///< zlib style complession
32 };
33 
34 class StringRef;
35 
36 class MCTargetOptions {
37 public:
38   enum AsmInstrumentation {
39     AsmInstrumentationNone,
40     AsmInstrumentationAddress
41   };
42 
43   bool MCRelaxAll : 1;
44   bool MCNoExecStack : 1;
45   bool MCFatalWarnings : 1;
46   bool MCNoWarn : 1;
47   bool MCNoDeprecatedWarn : 1;
48   bool MCNoTypeCheck : 1;
49   bool MCSaveTempLabels : 1;
50   bool MCUseDwarfDirectory : 1;
51   bool MCIncrementalLinkerCompatible : 1;
52   bool ShowMCEncoding : 1;
53   bool ShowMCInst : 1;
54   bool AsmVerbose : 1;
55 
56   /// Preserve Comments in Assembly.
57   bool PreserveAsmComments : 1;
58 
59   bool Dwarf64 : 1;
60   int DwarfVersion = 0;
61 
62   std::string ABIName;
63   std::string AssemblyLanguage;
64   std::string SplitDwarfFile;
65 
66   const char *Argv0 = nullptr;
67   ArrayRef<const char *> CommandLineArgs;
68 
69   /// Additional paths to search for `.include` directives when using the
70   /// integrated assembler.
71   std::vector<std::string> IASSearchPaths;
72 
73   MCTargetOptions();
74 
75   /// getABIName - If this returns a non-empty string this represents the
76   /// textual name of the ABI that we want the backend to use, e.g. o32, or
77   /// aapcs-linux.
78   StringRef getABIName() const;
79 
80   /// getAssemblyLanguage - If this returns a non-empty string this represents
81   /// the textual name of the assembly language that we will use for this
82   /// target, e.g. masm.
83   StringRef getAssemblyLanguage() const;
84 };
85 
86 } // end namespace llvm
87 
88 #endif // LLVM_MC_MCTARGETOPTIONS_H
89