blob: d29a74905ebf3199d202fb01b1f28e0daf8fbb0c [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- MCTargetOptions.h - MC Target Options --------------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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 Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_MC_MCTARGETOPTIONS_H
10#define LLVM_MC_MCTARGETOPTIONS_H
11
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020012#include "llvm/ADT/ArrayRef.h"
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010013#include <string>
14#include <vector>
15
16namespace llvm {
17
18enum class ExceptionHandling {
Andrew Walbran3d2c1972020-04-07 12:24:26 +010019 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 Deprezf4ef2d02021-04-20 13:36:24 +020025 AIX, ///< AIX Exception Handling
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010026};
27
28enum class DebugCompressionType {
Andrew Walbran3d2c1972020-04-07 12:24:26 +010029 None, ///< No compression
30 GNU, ///< zlib-gnu style compression
31 Z, ///< zlib style complession
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010032};
33
34class StringRef;
35
36class MCTargetOptions {
37public:
38 enum AsmInstrumentation {
39 AsmInstrumentationNone,
40 AsmInstrumentationAddress
41 };
42
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010043 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 Scull5e1ddfa2018-08-14 10:06:54 +010051 bool ShowMCEncoding : 1;
52 bool ShowMCInst : 1;
53 bool AsmVerbose : 1;
54
55 /// Preserve Comments in Assembly.
56 bool PreserveAsmComments : 1;
57
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020058 bool Dwarf64 : 1;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010059 int DwarfVersion = 0;
60
61 std::string ABIName;
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020062 std::string AssemblyLanguage;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010063 std::string SplitDwarfFile;
64
Olivier Deprezf4ef2d02021-04-20 13:36:24 +020065 const char *Argv0 = nullptr;
66 ArrayRef<const char *> CommandLineArgs;
67
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010068 /// 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 Deprezf4ef2d02021-04-20 13:36:24 +020078
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 Scull5e1ddfa2018-08-14 10:06:54 +010083};
84
85} // end namespace llvm
86
87#endif // LLVM_MC_MCTARGETOPTIONS_H