Convert MC command line option for fatal assembler warnings into a
[oota-llvm.git] / 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 namespace llvm {
14
15 class MCTargetOptions {
16 public:
17   enum AsmInstrumentation {
18     AsmInstrumentationNone,
19     AsmInstrumentationAddress
20   };
21
22   /// Enables AddressSanitizer instrumentation at machine level.
23   bool SanitizeAddress : 1;
24
25   bool MCRelaxAll : 1;
26   bool MCNoExecStack : 1;
27   bool MCFatalWarnings : 1;
28   bool MCSaveTempLabels : 1;
29   bool MCUseDwarfDirectory : 1;
30   bool ShowMCEncoding : 1;
31   bool ShowMCInst : 1;
32   bool AsmVerbose : 1;
33   int DwarfVersion;
34   MCTargetOptions();
35 };
36
37 inline bool operator==(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
38 #define ARE_EQUAL(X) LHS.X == RHS.X
39   return (ARE_EQUAL(SanitizeAddress) &&
40           ARE_EQUAL(MCRelaxAll) &&
41           ARE_EQUAL(MCNoExecStack) &&
42           ARE_EQUAL(MCFatalWarnings) &&
43           ARE_EQUAL(MCSaveTempLabels) &&
44           ARE_EQUAL(MCUseDwarfDirectory) &&
45           ARE_EQUAL(ShowMCEncoding) &&
46           ARE_EQUAL(ShowMCInst) &&
47           ARE_EQUAL(AsmVerbose) &&
48           ARE_EQUAL(DwarfVersion));
49 #undef ARE_EQUAL
50 }
51
52 inline bool operator!=(const MCTargetOptions &LHS, const MCTargetOptions &RHS) {
53   return !(LHS == RHS);
54 }
55
56 } // end namespace llvm
57
58 #endif