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