blob: f184620ff047b21b9cf2227407320ac14c545edd [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
12#include <string>
13#include <vector>
14
15namespace llvm {
16
17enum class ExceptionHandling {
Andrew Walbran3d2c1972020-04-07 12:24:26 +010018 None, ///< No exception support
19 DwarfCFI, ///< DWARF-like instruction based exceptions
20 SjLj, ///< setjmp/longjmp based exceptions
21 ARM, ///< ARM EHABI
22 WinEH, ///< Windows Exception Handling
23 Wasm, ///< WebAssembly Exception Handling
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010024};
25
26enum class DebugCompressionType {
Andrew Walbran3d2c1972020-04-07 12:24:26 +010027 None, ///< No compression
28 GNU, ///< zlib-gnu style compression
29 Z, ///< zlib style complession
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010030};
31
32class StringRef;
33
34class MCTargetOptions {
35public:
36 enum AsmInstrumentation {
37 AsmInstrumentationNone,
38 AsmInstrumentationAddress
39 };
40
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010041 bool MCRelaxAll : 1;
42 bool MCNoExecStack : 1;
43 bool MCFatalWarnings : 1;
44 bool MCNoWarn : 1;
45 bool MCNoDeprecatedWarn : 1;
46 bool MCSaveTempLabels : 1;
47 bool MCUseDwarfDirectory : 1;
48 bool MCIncrementalLinkerCompatible : 1;
49 bool MCPIECopyRelocations : 1;
50 bool ShowMCEncoding : 1;
51 bool ShowMCInst : 1;
52 bool AsmVerbose : 1;
53
54 /// Preserve Comments in Assembly.
55 bool PreserveAsmComments : 1;
56
57 int DwarfVersion = 0;
58
59 std::string ABIName;
60 std::string SplitDwarfFile;
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 /// getABIName - If this returns a non-empty string this represents the
69 /// textual name of the ABI that we want the backend to use, e.g. o32, or
70 /// aapcs-linux.
71 StringRef getABIName() const;
72};
73
74} // end namespace llvm
75
76#endif // LLVM_MC_MCTARGETOPTIONS_H