LLDB mainline
SafeMachO.h
Go to the documentation of this file.
1//===-- SafeMachO.h -----------------------------------*- 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#ifndef LLDB_HOST_SAFEMACHO_H
9#define LLDB_HOST_SAFEMACHO_H
10
11// This header file is required to work around collisions between the defines
12// in mach/machine.h, and enum members of the same name in llvm's MachO.h. If
13// you want to use llvm/Support/MachO.h, use this file instead. The caveats
14// are: 1) You can only use the MachO.h enums, you can't use the defines. That
15// won't make a difference since the values
16// are the same.
17// 2) If you need any header file that relies on mach/machine.h, you must
18// include that first. 3) This isn't a total solution, it doesn't undef every
19// define that MachO.h has borrowed from various system headers,
20// only the ones that come from mach/machine.h because that is the one we
21// ended up pulling in from various places.
22//
23
24#undef CPU_ARCH_MASK
25#undef CPU_ARCH_ABI64
26#undef CPU_ARCH_ABI64_32
27
28#undef CPU_TYPE_ANY
29#undef CPU_TYPE_X86
30#undef CPU_TYPE_I386
31#undef CPU_TYPE_X86_64
32#undef CPU_TYPE_MC98000
33#undef CPU_TYPE_ARM
34#undef CPU_TYPE_ARM64
35#undef CPU_TYPE_ARM64_32
36#undef CPU_TYPE_SPARC
37#undef CPU_TYPE_POWERPC
38#undef CPU_TYPE_POWERPC64
39
40#undef CPU_SUBTYPE_MASK
41#undef CPU_SUBTYPE_LIB64
42
43#undef CPU_SUBTYPE_MULTIPLE
44
45#undef CPU_SUBTYPE_I386_ALL
46#undef CPU_SUBTYPE_386
47#undef CPU_SUBTYPE_486
48#undef CPU_SUBTYPE_486SX
49#undef CPU_SUBTYPE_586
50#undef CPU_SUBTYPE_PENT
51#undef CPU_SUBTYPE_PENTPRO
52#undef CPU_SUBTYPE_PENTII_M3
53#undef CPU_SUBTYPE_PENTII_M5
54#undef CPU_SUBTYPE_CELERON
55#undef CPU_SUBTYPE_CELERON_MOBILE
56#undef CPU_SUBTYPE_PENTIUM_3
57#undef CPU_SUBTYPE_PENTIUM_3_M
58#undef CPU_SUBTYPE_PENTIUM_3_XEON
59#undef CPU_SUBTYPE_PENTIUM_M
60#undef CPU_SUBTYPE_PENTIUM_4
61#undef CPU_SUBTYPE_PENTIUM_4_M
62#undef CPU_SUBTYPE_ITANIUM
63#undef CPU_SUBTYPE_ITANIUM_2
64#undef CPU_SUBTYPE_XEON
65#undef CPU_SUBTYPE_XEON_MP
66
67#undef CPU_SUBTYPE_X86_ALL
68#undef CPU_SUBTYPE_X86_64_ALL
69#undef CPU_SUBTYPE_X86_ARCH1
70#undef CPU_SUBTYPE_X86_64_H
71
72#undef CPU_SUBTYPE_INTEL
73#undef CPU_SUBTYPE_INTEL_FAMILY
74#undef CPU_SUBTYPE_INTEL_FAMILY_MAX
75#undef CPU_SUBTYPE_INTEL_MODEL
76#undef CPU_SUBTYPE_INTEL_MODEL_ALL
77
78#undef CPU_SUBTYPE_ARM
79#undef CPU_SUBTYPE_ARM_ALL
80#undef CPU_SUBTYPE_ARM_V4T
81#undef CPU_SUBTYPE_ARM_V6
82#undef CPU_SUBTYPE_ARM_V5
83#undef CPU_SUBTYPE_ARM_V5TEJ
84#undef CPU_SUBTYPE_ARM_XSCALE
85#undef CPU_SUBTYPE_ARM_V7
86
87#undef CPU_SUBTYPE_ARM_V7S
88#undef CPU_SUBTYPE_ARM_V7K
89#undef CPU_SUBTYPE_ARM_V6M
90#undef CPU_SUBTYPE_ARM_V7M
91#undef CPU_SUBTYPE_ARM_V7EM
92
93#undef CPU_SUBTYPE_ARM_V8M_MAIN
94#undef CPU_SUBTYPE_ARM_V8M_BASE
95#undef CPU_SUBTYPE_ARM_V8_1M_MAIN
96
97#undef CPU_SUBTYPE_ARM64E
98#undef CPU_SUBTYPE_ARM64_32_V8
99#undef CPU_SUBTYPE_ARM64_V8
100#undef CPU_SUBTYPE_ARM64E_X1
101#undef CPU_SUBTYPE_ARM64_ALL
102
103#undef CPU_SUBTYPE_SPARC_ALL
104
105#undef CPU_SUBTYPE_POWERPC
106#undef CPU_SUBTYPE_POWERPC_ALL
107#undef CPU_SUBTYPE_POWERPC_601
108#undef CPU_SUBTYPE_POWERPC_602
109#undef CPU_SUBTYPE_POWERPC_603
110#undef CPU_SUBTYPE_POWERPC_603e
111#undef CPU_SUBTYPE_POWERPC_603ev
112#undef CPU_SUBTYPE_POWERPC_604
113#undef CPU_SUBTYPE_POWERPC_604e
114#undef CPU_SUBTYPE_POWERPC_620
115#undef CPU_SUBTYPE_POWERPC_750
116#undef CPU_SUBTYPE_POWERPC_7400
117#undef CPU_SUBTYPE_POWERPC_7450
118#undef CPU_SUBTYPE_POWERPC_970
119
120#undef CPU_SUBTYPE_MC980000_ALL
121#undef CPU_SUBTYPE_MC98601
122
123#undef VM_PROT_READ
124#undef VM_PROT_WRITE
125#undef VM_PROT_EXECUTE
126
127#undef ARM_DEBUG_STATE
128#undef ARM_EXCEPTION_STATE
129#undef ARM_EXCEPTION_STATE64
130#undef ARM_EXCEPTION_STATE64_COUNT
131#undef ARM_THREAD_STATE
132#undef ARM_THREAD_STATE64
133#undef ARM_THREAD_STATE64_COUNT
134#undef ARM_THREAD_STATE_COUNT
135#undef ARM_VFP_STATE
136#undef ARN_THREAD_STATE_NONE
137#undef PPC_EXCEPTION_STATE
138#undef PPC_EXCEPTION_STATE64
139#undef PPC_FLOAT_STATE
140#undef PPC_THREAD_STATE
141#undef PPC_THREAD_STATE64
142#undef PPC_THREAD_STATE_NONE
143#undef PPC_VECTOR_STATE
144#undef x86_DEBUG_STATE
145#undef x86_DEBUG_STATE32
146#undef x86_DEBUG_STATE64
147#undef x86_EXCEPTION_STATE
148#undef x86_EXCEPTION_STATE32
149#undef x86_EXCEPTION_STATE64
150#undef x86_EXCEPTION_STATE64_COUNT
151#undef x86_EXCEPTION_STATE_COUNT
152#undef x86_FLOAT_STATE
153#undef x86_FLOAT_STATE32
154#undef x86_FLOAT_STATE64
155#undef x86_FLOAT_STATE64_COUNT
156#undef x86_FLOAT_STATE_COUNT
157#undef x86_THREAD_STATE
158#undef x86_THREAD_STATE32
159#undef x86_THREAD_STATE32_COUNT
160#undef x86_THREAD_STATE64
161#undef x86_THREAD_STATE64_COUNT
162#undef x86_THREAD_STATE_COUNT
163
164#include "llvm/BinaryFormat/MachO.h"
165
166#endif // LLDB_HOST_SAFEMACHO_H