clang 20.0.0git
OSTargets.h
Go to the documentation of this file.
1//===--- OSTargets.h - Declare OS target feature support --------*- 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//
9// This file declares OS specific TargetInfo types.
10//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_OSTARGETS_H
13#define LLVM_CLANG_LIB_BASIC_TARGETS_OSTARGETS_H
14
15#include "Targets.h"
16
17namespace clang {
18namespace targets {
19
20template <typename TgtInfo>
21class LLVM_LIBRARY_VISIBILITY OSTargetInfo : public TgtInfo {
22protected:
23 virtual void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
24 MacroBuilder &Builder) const = 0;
25
26public:
27 OSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
28 : TgtInfo(Triple, Opts) {}
29
30 void getTargetDefines(const LangOptions &Opts,
31 MacroBuilder &Builder) const override {
32 TgtInfo::getTargetDefines(Opts, Builder);
33 getOSDefines(Opts, TgtInfo::getTriple(), Builder);
34 }
35};
36
37void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts,
38 const llvm::Triple &Triple, StringRef &PlatformName,
39 VersionTuple &PlatformMinVersion);
40
41template <typename Target>
42class LLVM_LIBRARY_VISIBILITY DarwinTargetInfo : public OSTargetInfo<Target> {
43protected:
44 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
45 MacroBuilder &Builder) const override {
46 getDarwinDefines(Builder, Opts, Triple, this->PlatformName,
47 this->PlatformMinVersion);
48 }
49
50public:
51 DarwinTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
52 : OSTargetInfo<Target>(Triple, Opts) {
53 // By default, no TLS, and we list permitted architecture/OS
54 // combinations.
55 this->TLSSupported = false;
56
57 if (Triple.isMacOSX())
58 this->TLSSupported = !Triple.isMacOSXVersionLT(10, 7);
59 else if (Triple.isiOS()) {
60 // 64-bit iOS supported it from 8 onwards, 32-bit device from 9 onwards,
61 // 32-bit simulator from 10 onwards.
62 if (Triple.isArch64Bit())
63 this->TLSSupported = !Triple.isOSVersionLT(8);
64 else if (Triple.isArch32Bit()) {
65 if (!Triple.isSimulatorEnvironment())
66 this->TLSSupported = !Triple.isOSVersionLT(9);
67 else
68 this->TLSSupported = !Triple.isOSVersionLT(10);
69 }
70 } else if (Triple.isWatchOS()) {
71 if (!Triple.isSimulatorEnvironment())
72 this->TLSSupported = !Triple.isOSVersionLT(2);
73 else
74 this->TLSSupported = !Triple.isOSVersionLT(3);
75 } else if (Triple.isDriverKit()) {
76 // No TLS on DriverKit.
77 } else if (Triple.isXROS())
78 this->TLSSupported = true;
79
80 this->MCountName = "\01mcount";
81 }
82
83 const char *getStaticInitSectionSpecifier() const override {
84 // FIXME: We should return 0 when building kexts.
85 return "__TEXT,__StaticInit,regular,pure_instructions";
86 }
87
88 /// Darwin does not support protected visibility. Darwin's "default"
89 /// is very similar to ELF's "protected"; Darwin requires a "weak"
90 /// attribute on declarations that can be dynamically replaced.
91 bool hasProtectedVisibility() const override { return false; }
92
93 unsigned getExnObjectAlignment() const override {
94 // Older versions of libc++abi guarantee an alignment of only 8-bytes for
95 // exception objects because of a bug in __cxa_exception that was
96 // eventually fixed in r319123.
97 llvm::VersionTuple MinVersion;
98 const llvm::Triple &T = this->getTriple();
99
100 // Compute the earliest OS versions that have the fix to libc++abi.
101 switch (T.getOS()) {
102 case llvm::Triple::Darwin:
103 case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
104 MinVersion = llvm::VersionTuple(10U, 14U);
105 break;
106 case llvm::Triple::IOS:
107 case llvm::Triple::TvOS: // Earliest supporting version is 12.0.0.
108 MinVersion = llvm::VersionTuple(12U);
109 break;
110 case llvm::Triple::WatchOS: // Earliest supporting version is 5.0.0.
111 MinVersion = llvm::VersionTuple(5U);
112 break;
113 case llvm::Triple::XROS:
114 MinVersion = llvm::VersionTuple(0);
115 break;
116 default:
117 // Conservatively return 8 bytes if OS is unknown.
118 return 64;
119 }
120
121 if (T.getOSVersion() < MinVersion)
122 return 64;
124 }
125
127 bool IsSigned) const final {
128 // Darwin uses `long long` for `int_least64_t` and `int_fast64_t`.
129 return BitWidth == 64
130 ? (IsSigned ? TargetInfo::SignedLongLong
131 : TargetInfo::UnsignedLongLong)
132 : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
133 }
134
135 bool areDefaultedSMFStillPOD(const LangOptions &) const override {
136 return false;
137 }
138};
139
140// DragonFlyBSD Target
141template <typename Target>
142class LLVM_LIBRARY_VISIBILITY DragonFlyBSDTargetInfo
143 : public OSTargetInfo<Target> {
144protected:
145 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
146 MacroBuilder &Builder) const override {
147 // DragonFly defines; list based off of gcc output
148 Builder.defineMacro("__DragonFly__");
149 Builder.defineMacro("__DragonFly_cc_version", "100001");
150 Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
151 Builder.defineMacro("__tune_i386__");
152 DefineStd(Builder, "unix", Opts);
153 if (this->HasFloat128)
154 Builder.defineMacro("__FLOAT128__");
155 }
156
157public:
158 DragonFlyBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
159 : OSTargetInfo<Target>(Triple, Opts) {
160 switch (Triple.getArch()) {
161 default:
162 case llvm::Triple::x86:
163 case llvm::Triple::x86_64:
164 this->HasFloat128 = true;
165 this->MCountName = ".mcount";
166 break;
167 }
168 }
169};
170
171#ifndef FREEBSD_CC_VERSION
172#define FREEBSD_CC_VERSION 0U
173#endif
174
175// FreeBSD Target
176template <typename Target>
177class LLVM_LIBRARY_VISIBILITY FreeBSDTargetInfo : public OSTargetInfo<Target> {
178protected:
179 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
180 MacroBuilder &Builder) const override {
181 // FreeBSD defines; list based off of gcc output
182
183 unsigned Release = Triple.getOSMajorVersion();
184 if (Release == 0U)
185 Release = 8U;
186 unsigned CCVersion = FREEBSD_CC_VERSION;
187 if (CCVersion == 0U)
188 CCVersion = Release * 100000U + 1U;
189
190 Builder.defineMacro("__FreeBSD__", Twine(Release));
191 Builder.defineMacro("__FreeBSD_cc_version", Twine(CCVersion));
192 Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
193 DefineStd(Builder, "unix", Opts);
194 if (this->HasFloat128)
195 Builder.defineMacro("__FLOAT128__");
196
197 // On FreeBSD, wchar_t contains the number of the code point as
198 // used by the character set of the locale. These character sets are
199 // not necessarily a superset of ASCII.
200 //
201 // FIXME: This is wrong; the macro refers to the numerical values
202 // of wchar_t *literals*, which are not locale-dependent. However,
203 // FreeBSD systems apparently depend on us getting this wrong, and
204 // setting this to 1 is conforming even if all the basic source
205 // character literals have the same encoding as char and wchar_t.
206 Builder.defineMacro("__STDC_MB_MIGHT_NEQ_WC__", "1");
207 }
208
209public:
210 FreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
211 : OSTargetInfo<Target>(Triple, Opts) {
212 switch (Triple.getArch()) {
213 case llvm::Triple::x86:
214 case llvm::Triple::x86_64:
215 this->HasFloat128 = true;
216 [[fallthrough]];
217 default:
218 this->MCountName = ".mcount";
219 break;
220 case llvm::Triple::mips:
221 case llvm::Triple::mipsel:
222 case llvm::Triple::ppc:
223 case llvm::Triple::ppcle:
224 case llvm::Triple::ppc64:
225 case llvm::Triple::ppc64le:
226 this->MCountName = "_mcount";
227 break;
228 case llvm::Triple::arm:
229 this->MCountName = "__mcount";
230 break;
231 case llvm::Triple::riscv32:
232 case llvm::Triple::riscv64:
233 break;
234 case llvm::Triple::loongarch32:
235 case llvm::Triple::loongarch64:
236 break;
237 }
238 }
239};
240
241// GNU/kFreeBSD Target
242template <typename Target>
243class LLVM_LIBRARY_VISIBILITY KFreeBSDTargetInfo : public OSTargetInfo<Target> {
244protected:
245 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
246 MacroBuilder &Builder) const override {
247 // GNU/kFreeBSD defines; list based off of gcc output
248
249 DefineStd(Builder, "unix", Opts);
250 Builder.defineMacro("__FreeBSD_kernel__");
251 Builder.defineMacro("__GLIBC__");
252 if (Opts.POSIXThreads)
253 Builder.defineMacro("_REENTRANT");
254 if (Opts.CPlusPlus)
255 Builder.defineMacro("_GNU_SOURCE");
256 }
257
258public:
259 using OSTargetInfo<Target>::OSTargetInfo;
260};
261
262// Haiku Target
263template <typename Target>
264class LLVM_LIBRARY_VISIBILITY HaikuTargetInfo : public OSTargetInfo<Target> {
265protected:
266 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
267 MacroBuilder &Builder) const override {
268 // Haiku defines; list based off of gcc output
269 Builder.defineMacro("__HAIKU__");
270 DefineStd(Builder, "unix", Opts);
271 if (this->HasFloat128)
272 Builder.defineMacro("__FLOAT128__");
273 }
274
275public:
276 HaikuTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
277 : OSTargetInfo<Target>(Triple, Opts) {
278 this->SizeType = TargetInfo::UnsignedLong;
279 this->IntPtrType = TargetInfo::SignedLong;
280 this->PtrDiffType = TargetInfo::SignedLong;
281 this->ProcessIDType = TargetInfo::SignedLong;
282 switch (Triple.getArch()) {
283 default:
284 break;
285 case llvm::Triple::x86:
286 case llvm::Triple::x86_64:
287 this->HasFloat128 = true;
288 break;
289 }
290 }
291};
292
293// Hurd target
294template <typename Target>
295class LLVM_LIBRARY_VISIBILITY HurdTargetInfo : public OSTargetInfo<Target> {
296protected:
297 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
298 MacroBuilder &Builder) const override {
299 // Hurd defines; list based off of gcc output.
300 DefineStd(Builder, "unix", Opts);
301 Builder.defineMacro("__GNU__");
302 Builder.defineMacro("__gnu_hurd__");
303 Builder.defineMacro("__MACH__");
304 Builder.defineMacro("__GLIBC__");
305 if (Opts.POSIXThreads)
306 Builder.defineMacro("_REENTRANT");
307 if (Opts.CPlusPlus)
308 Builder.defineMacro("_GNU_SOURCE");
309 }
310public:
311 using OSTargetInfo<Target>::OSTargetInfo;
312};
313
314// Linux target
315template <typename Target>
316class LLVM_LIBRARY_VISIBILITY LinuxTargetInfo : public OSTargetInfo<Target> {
317protected:
318 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
319 MacroBuilder &Builder) const override {
320 // Linux defines; list based off of gcc output
321 DefineStd(Builder, "unix", Opts);
322 DefineStd(Builder, "linux", Opts);
323 if (Triple.isAndroid()) {
324 Builder.defineMacro("__ANDROID__", "1");
325 this->PlatformName = "android";
326 this->PlatformMinVersion = Triple.getEnvironmentVersion();
327 const unsigned Maj = this->PlatformMinVersion.getMajor();
328 if (Maj) {
329 Builder.defineMacro("__ANDROID_MIN_SDK_VERSION__", Twine(Maj));
330 // This historical but ambiguous name for the minSdkVersion macro. Keep
331 // defined for compatibility.
332 Builder.defineMacro("__ANDROID_API__", "__ANDROID_MIN_SDK_VERSION__");
333 }
334 } else {
335 Builder.defineMacro("__gnu_linux__");
336 }
337 if (Opts.POSIXThreads)
338 Builder.defineMacro("_REENTRANT");
339 if (Opts.CPlusPlus)
340 Builder.defineMacro("_GNU_SOURCE");
341 if (this->HasFloat128)
342 Builder.defineMacro("__FLOAT128__");
343 if (Triple.isTime64ABI()) {
344 Builder.defineMacro("_FILE_OFFSET_BITS", "64");
345 Builder.defineMacro("_TIME_BITS", "64");
346 }
347 }
348
349public:
350 LinuxTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
351 : OSTargetInfo<Target>(Triple, Opts) {
352 this->WIntType = TargetInfo::UnsignedInt;
353
354 switch (Triple.getArch()) {
355 default:
356 break;
357 case llvm::Triple::mips:
358 case llvm::Triple::mipsel:
359 case llvm::Triple::mips64:
360 case llvm::Triple::mips64el:
361 case llvm::Triple::ppc:
362 case llvm::Triple::ppcle:
363 case llvm::Triple::ppc64:
364 case llvm::Triple::ppc64le:
365 this->MCountName = "_mcount";
366 break;
367 case llvm::Triple::x86:
368 case llvm::Triple::x86_64:
369 this->HasFloat128 = true;
370 break;
371 }
372 }
373
374 const char *getStaticInitSectionSpecifier() const override {
375 return ".text.startup";
376 }
377};
378
379// NetBSD Target
380template <typename Target>
381class LLVM_LIBRARY_VISIBILITY NetBSDTargetInfo : public OSTargetInfo<Target> {
382protected:
383 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
384 MacroBuilder &Builder) const override {
385 // NetBSD defines; list based off of gcc output
386 Builder.defineMacro("__NetBSD__");
387 Builder.defineMacro("__unix__");
388 if (Opts.POSIXThreads)
389 Builder.defineMacro("_REENTRANT");
390 if (this->HasFloat128)
391 Builder.defineMacro("__FLOAT128__");
392 }
393
394public:
395 NetBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
396 : OSTargetInfo<Target>(Triple, Opts) {
397 this->MCountName = "__mcount";
398 switch (Triple.getArch()) {
399 default:
400 break;
401 case llvm::Triple::x86:
402 case llvm::Triple::x86_64:
403 this->HasFloat128 = true;
404 break;
405 }
406 }
407};
408
409// OpenBSD Target
410template <typename Target>
411class LLVM_LIBRARY_VISIBILITY OpenBSDTargetInfo : public OSTargetInfo<Target> {
412protected:
413 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
414 MacroBuilder &Builder) const override {
415 // OpenBSD defines; list based off of gcc output
416
417 Builder.defineMacro("__OpenBSD__");
418 DefineStd(Builder, "unix", Opts);
419 if (Opts.POSIXThreads)
420 Builder.defineMacro("_REENTRANT");
421 if (this->HasFloat128)
422 Builder.defineMacro("__FLOAT128__");
423
424 if (Opts.C11)
425 Builder.defineMacro("__STDC_NO_THREADS__");
426 }
427
428public:
429 OpenBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
430 : OSTargetInfo<Target>(Triple, Opts) {
431 this->WCharType = this->WIntType = this->SignedInt;
432 this->IntMaxType = TargetInfo::SignedLongLong;
433 this->Int64Type = TargetInfo::SignedLongLong;
434 switch (Triple.getArch()) {
435 case llvm::Triple::x86:
436 case llvm::Triple::x86_64:
437 this->HasFloat128 = true;
438 [[fallthrough]];
439 default:
440 this->MCountName = "__mcount";
441 break;
442 case llvm::Triple::mips64:
443 case llvm::Triple::mips64el:
444 case llvm::Triple::ppc:
445 case llvm::Triple::ppc64:
446 case llvm::Triple::ppc64le:
447 case llvm::Triple::sparcv9:
448 this->MCountName = "_mcount";
449 break;
450 case llvm::Triple::riscv32:
451 case llvm::Triple::riscv64:
452 break;
453 }
454 }
455};
456
457// PS3 PPU Target
458template <typename Target>
459class LLVM_LIBRARY_VISIBILITY PS3PPUTargetInfo : public OSTargetInfo<Target> {
460protected:
461 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
462 MacroBuilder &Builder) const override {
463 // PS3 PPU defines.
464 Builder.defineMacro("__PPU__");
465 Builder.defineMacro("__CELLOS_LV2__");
466 Builder.defineMacro("__LP32__");
467 Builder.defineMacro("_ARCH_PPC64");
468 Builder.defineMacro("__powerpc64__");
469 }
470
471public:
472 PS3PPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
473 : OSTargetInfo<Target>(Triple, Opts) {
474 this->LongWidth = this->LongAlign = 32;
475 this->PointerWidth = this->PointerAlign = 32;
476 this->IntMaxType = TargetInfo::SignedLongLong;
477 this->Int64Type = TargetInfo::SignedLongLong;
478 this->SizeType = TargetInfo::UnsignedInt;
479 this->resetDataLayout("E-m:e-p:32:32-Fi64-i64:64-i128:128-n32:64");
480 }
481};
482
483// Common base class for PS4/PS5 targets.
484template <typename Target>
485class LLVM_LIBRARY_VISIBILITY PSOSTargetInfo : public OSTargetInfo<Target> {
486protected:
487 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
488 MacroBuilder &Builder) const override {
489 Builder.defineMacro("__FreeBSD__", "9");
490 Builder.defineMacro("__FreeBSD_cc_version", "900001");
491 Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
492 DefineStd(Builder, "unix", Opts);
493 Builder.defineMacro("__SCE__");
494 Builder.defineMacro("__STDC_NO_COMPLEX__");
495 Builder.defineMacro("__STDC_NO_THREADS__");
496 }
497
498public:
499 PSOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
500 : OSTargetInfo<Target>(Triple, Opts) {
501 this->WCharType = TargetInfo::UnsignedShort;
502
503 // On PS4/PS5, TLS variable cannot be aligned to more than 32 bytes (256
504 // bits).
505 this->MaxTLSAlign = 256;
506
507 // On PS4/PS5, do not honor explicit bit field alignment,
508 // as in "__attribute__((aligned(2))) int b : 1;".
509 this->UseExplicitBitFieldAlignment = false;
510
511 this->MCountName = ".mcount";
512 this->NewAlign = 256;
513 this->SuitableAlign = 256;
514 }
515
518 return (CC == CC_C) ? TargetInfo::CCCR_OK : TargetInfo::CCCR_Error;
519 }
520
521 bool areDefaultedSMFStillPOD(const LangOptions &) const override {
522 return false;
523 }
524};
525
526// PS4 Target
527template <typename Target>
528class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public PSOSTargetInfo<Target> {
529protected:
530 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
531 MacroBuilder &Builder) const override {
532 // Start with base class defines.
533 PSOSTargetInfo<Target>::getOSDefines(Opts, Triple, Builder);
534
535 Builder.defineMacro("__ORBIS__");
536 }
537
538public:
539 using PSOSTargetInfo<Target>::PSOSTargetInfo;
540};
541
542// PS5 Target
543template <typename Target>
544class LLVM_LIBRARY_VISIBILITY PS5OSTargetInfo : public PSOSTargetInfo<Target> {
545protected:
546 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
547 MacroBuilder &Builder) const override {
548 // Start with base class defines.
549 PSOSTargetInfo<Target>::getOSDefines(Opts, Triple, Builder);
550
551 Builder.defineMacro("__PROSPERO__");
552 }
553
554public:
555 using PSOSTargetInfo<Target>::PSOSTargetInfo;
556};
557
558// RTEMS Target
559template <typename Target>
560class LLVM_LIBRARY_VISIBILITY RTEMSTargetInfo : public OSTargetInfo<Target> {
561protected:
562 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
563 MacroBuilder &Builder) const override {
564 // RTEMS defines; list based off of gcc output
565
566 Builder.defineMacro("__rtems__");
567 if (Opts.CPlusPlus)
568 Builder.defineMacro("_GNU_SOURCE");
569 }
570
571public:
572 RTEMSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
573 : OSTargetInfo<Target>(Triple, Opts) {
574 switch (Triple.getArch()) {
575 default:
576 case llvm::Triple::x86:
577 // this->MCountName = ".mcount";
578 break;
579 case llvm::Triple::mips:
580 case llvm::Triple::mipsel:
581 case llvm::Triple::ppc:
582 case llvm::Triple::ppc64:
583 case llvm::Triple::ppc64le:
584 // this->MCountName = "_mcount";
585 break;
586 case llvm::Triple::arm:
587 // this->MCountName = "__mcount";
588 break;
589 }
590 }
591};
592
593// Solaris target
594template <typename Target>
595class LLVM_LIBRARY_VISIBILITY SolarisTargetInfo : public OSTargetInfo<Target> {
596protected:
597 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
598 MacroBuilder &Builder) const override {
599 DefineStd(Builder, "sun", Opts);
600 DefineStd(Builder, "unix", Opts);
601 Builder.defineMacro("__svr4__");
602 Builder.defineMacro("__SVR4");
603 // Solaris headers require _XOPEN_SOURCE to be set to 600 for C99 and
604 // newer, but to 500 for everything else. feature_test.h has a check to
605 // ensure that you are not using C99 with an old version of X/Open or C89
606 // with a new version.
607 if (Opts.C99)
608 Builder.defineMacro("_XOPEN_SOURCE", "600");
609 else
610 Builder.defineMacro("_XOPEN_SOURCE", "500");
611 if (Opts.CPlusPlus) {
612 Builder.defineMacro("__C99FEATURES__");
613 Builder.defineMacro("_FILE_OFFSET_BITS", "64");
614 }
615 // GCC restricts the next two to C++.
616 Builder.defineMacro("_LARGEFILE_SOURCE");
617 Builder.defineMacro("_LARGEFILE64_SOURCE");
618 Builder.defineMacro("__EXTENSIONS__");
619 if (Opts.POSIXThreads)
620 Builder.defineMacro("_REENTRANT");
621 if (this->HasFloat128)
622 Builder.defineMacro("__FLOAT128__");
623 }
624
625public:
626 SolarisTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
627 : OSTargetInfo<Target>(Triple, Opts) {
628 if (this->PointerWidth == 64) {
629 this->WCharType = this->WIntType = this->SignedInt;
630 } else {
631 this->WCharType = this->WIntType = this->SignedLong;
632 }
633 switch (Triple.getArch()) {
634 default:
635 break;
636 case llvm::Triple::x86:
637 case llvm::Triple::x86_64:
638 this->HasFloat128 = true;
639 break;
640 }
641 }
642};
643
644// AIX Target
645template <typename Target>
646class AIXTargetInfo : public OSTargetInfo<Target> {
647protected:
648 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
649 MacroBuilder &Builder) const override {
650 DefineStd(Builder, "unix", Opts);
651 Builder.defineMacro("_IBMR2");
652 Builder.defineMacro("_POWER");
653 Builder.defineMacro("__THW_BIG_ENDIAN__");
654
655 Builder.defineMacro("_AIX");
656 Builder.defineMacro("__TOS_AIX__");
657 Builder.defineMacro("__HOS_AIX__");
658
659 if (Opts.C11) {
660 Builder.defineMacro("__STDC_NO_ATOMICS__");
661 Builder.defineMacro("__STDC_NO_THREADS__");
662 }
663
664 if (Opts.EnableAIXExtendedAltivecABI)
665 Builder.defineMacro("__EXTABI__");
666
667 VersionTuple OsVersion = Triple.getOSVersion();
668
669 // Define AIX OS-Version Macros.
670 // Includes logic for legacy versions of AIX; no specific intent to support.
671 if (OsVersion >= VersionTuple(3, 2))
672 Builder.defineMacro("_AIX32");
673 if (OsVersion >= VersionTuple(4, 1))
674 Builder.defineMacro("_AIX41");
675 if (OsVersion >= VersionTuple(4, 3))
676 Builder.defineMacro("_AIX43");
677 if (OsVersion >= VersionTuple(5, 0))
678 Builder.defineMacro("_AIX50");
679 if (OsVersion >= VersionTuple(5, 1))
680 Builder.defineMacro("_AIX51");
681 if (OsVersion >= VersionTuple(5, 2))
682 Builder.defineMacro("_AIX52");
683 if (OsVersion >= VersionTuple(5, 3))
684 Builder.defineMacro("_AIX53");
685 if (OsVersion >= VersionTuple(6, 1))
686 Builder.defineMacro("_AIX61");
687 if (OsVersion >= VersionTuple(7, 1))
688 Builder.defineMacro("_AIX71");
689 if (OsVersion >= VersionTuple(7, 2))
690 Builder.defineMacro("_AIX72");
691 if (OsVersion >= VersionTuple(7, 3))
692 Builder.defineMacro("_AIX73");
693
694 // FIXME: Do not define _LONG_LONG when -fno-long-long is specified.
695 Builder.defineMacro("_LONG_LONG");
696
697 if (Opts.POSIXThreads) {
698 Builder.defineMacro("_THREAD_SAFE");
699 }
700
701 if (this->PointerWidth == 64) {
702 Builder.defineMacro("__64BIT__");
703 }
704
705 // Define _WCHAR_T when it is a fundamental type
706 // (i.e., for C++ without -fno-wchar).
707 if (Opts.CPlusPlus && Opts.WChar) {
708 Builder.defineMacro("_WCHAR_T");
709 }
710 }
711
712public:
713 AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
714 : OSTargetInfo<Target>(Triple, Opts) {
715 this->MCountName = "__mcount";
716 this->TheCXXABI.set(TargetCXXABI::XL);
717
718 if (this->PointerWidth == 64) {
719 this->WCharType = this->UnsignedInt;
720 } else {
721 this->WCharType = this->UnsignedShort;
722 }
723 this->UseZeroLengthBitfieldAlignment = true;
724 }
725
726 // AIX sets FLT_EVAL_METHOD to be 1.
729 }
730
731 bool defaultsToAIXPowerAlignment() const override { return true; }
732
733 bool areDefaultedSMFStillPOD(const LangOptions &) const override {
734 return false;
735 }
736};
737
738// z/OS target
739template <typename Target>
740class LLVM_LIBRARY_VISIBILITY ZOSTargetInfo : public OSTargetInfo<Target> {
741protected:
742 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
743 MacroBuilder &Builder) const override {
744 // FIXME: _LONG_LONG should not be defined under -std=c89.
745 Builder.defineMacro("_LONG_LONG");
746 Builder.defineMacro("__370__");
747 Builder.defineMacro("__BFP__");
748 // FIXME: __BOOL__ should not be defined under -std=c89.
749 Builder.defineMacro("__BOOL__");
750 Builder.defineMacro("__COMPILER_VER__", "0x50000000");
751 Builder.defineMacro("__LONGNAME__");
752 Builder.defineMacro("__MVS__");
753 Builder.defineMacro("__THW_370__");
754 Builder.defineMacro("__THW_BIG_ENDIAN__");
755 Builder.defineMacro("__TOS_390__");
756 Builder.defineMacro("__TOS_MVS__");
757 Builder.defineMacro("__XPLINK__");
758
759 if (this->PointerWidth == 64)
760 Builder.defineMacro("__64BIT__");
761
762 if (Opts.CPlusPlus && Opts.WChar) {
763 // Macro __wchar_t is defined so that the wchar_t data
764 // type is not declared as a typedef in system headers.
765 Builder.defineMacro("__wchar_t");
766 }
767
768 this->PlatformName = llvm::Triple::getOSTypeName(Triple.getOS());
769 }
770
771public:
772 ZOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
773 : OSTargetInfo<Target>(Triple, Opts) {
774 this->WCharType = TargetInfo::UnsignedInt;
775 this->MaxAlignedAttribute = 128;
776 this->UseBitFieldTypeAlignment = false;
777 this->UseZeroLengthBitfieldAlignment = true;
778 this->UseLeadingZeroLengthBitfield = false;
779 this->ZeroLengthBitfieldBoundary = 32;
780 this->TheCXXABI.set(TargetCXXABI::XL);
781 }
782
783 bool areDefaultedSMFStillPOD(const LangOptions &) const override {
784 return false;
785 }
786};
787
788// UEFI target
789template <typename Target>
790class LLVM_LIBRARY_VISIBILITY UEFITargetInfo : public OSTargetInfo<Target> {
791protected:
792 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
793 MacroBuilder &Builder) const override {}
794
795public:
796 UEFITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
797 : OSTargetInfo<Target>(Triple, Opts) {
798 this->WCharType = TargetInfo::UnsignedShort;
799 this->WIntType = TargetInfo::UnsignedShort;
800 }
801};
802
803void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
804 MacroBuilder &Builder);
805
806// Windows target
807template <typename Target>
808class LLVM_LIBRARY_VISIBILITY WindowsTargetInfo : public OSTargetInfo<Target> {
809protected:
810 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
811 MacroBuilder &Builder) const override {
812 addWindowsDefines(Triple, Opts, Builder);
813 }
814
815public:
816 WindowsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
817 : OSTargetInfo<Target>(Triple, Opts) {
818 this->WCharType = TargetInfo::UnsignedShort;
819 this->WIntType = TargetInfo::UnsignedShort;
820 }
821};
822
823template <typename Target>
824class LLVM_LIBRARY_VISIBILITY NaClTargetInfo : public OSTargetInfo<Target> {
825protected:
826 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
827 MacroBuilder &Builder) const override {
828 if (Opts.POSIXThreads)
829 Builder.defineMacro("_REENTRANT");
830 if (Opts.CPlusPlus)
831 Builder.defineMacro("_GNU_SOURCE");
832
833 DefineStd(Builder, "unix", Opts);
834 Builder.defineMacro("__native_client__");
835 }
836
837public:
838 NaClTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
839 : OSTargetInfo<Target>(Triple, Opts) {
840 this->LongAlign = 32;
841 this->LongWidth = 32;
842 this->PointerAlign = 32;
843 this->PointerWidth = 32;
844 this->IntMaxType = TargetInfo::SignedLongLong;
845 this->Int64Type = TargetInfo::SignedLongLong;
846 this->DoubleAlign = 64;
847 this->LongDoubleWidth = 64;
848 this->LongDoubleAlign = 64;
849 this->LongLongWidth = 64;
850 this->LongLongAlign = 64;
851 this->SizeType = TargetInfo::UnsignedInt;
852 this->PtrDiffType = TargetInfo::SignedInt;
853 this->IntPtrType = TargetInfo::SignedInt;
854 // RegParmMax is inherited from the underlying architecture.
855 this->LongDoubleFormat = &llvm::APFloat::IEEEdouble();
856 if (Triple.getArch() == llvm::Triple::arm) {
857 // Handled in ARM's setABI().
858 } else if (Triple.getArch() == llvm::Triple::x86) {
859 this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
860 "i64:64-i128:128-n8:16:32-S128");
861 } else if (Triple.getArch() == llvm::Triple::x86_64) {
862 this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
863 "i64:64-i128:128-n8:16:32:64-S128");
864 } else if (Triple.getArch() == llvm::Triple::mipsel) {
865 // Handled on mips' setDataLayout.
866 }
867 }
868};
869
870// Fuchsia Target
871template <typename Target>
872class LLVM_LIBRARY_VISIBILITY FuchsiaTargetInfo : public OSTargetInfo<Target> {
873protected:
874 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
875 MacroBuilder &Builder) const override {
876 Builder.defineMacro("__Fuchsia__");
877 if (Opts.POSIXThreads)
878 Builder.defineMacro("_REENTRANT");
879 // Required by the libc++ locale support.
880 if (Opts.CPlusPlus)
881 Builder.defineMacro("_GNU_SOURCE");
882 Builder.defineMacro("__Fuchsia_API_level__", Twine(Opts.FuchsiaAPILevel));
883 this->PlatformName = "fuchsia";
884 this->PlatformMinVersion = VersionTuple(Opts.FuchsiaAPILevel);
885 }
886
887public:
888 FuchsiaTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
889 : OSTargetInfo<Target>(Triple, Opts) {
890 this->WIntType = TargetInfo::UnsignedInt;
891 this->MCountName = "__mcount";
892 this->TheCXXABI.set(TargetCXXABI::Fuchsia);
893 }
894};
895
896// WebAssembly target
897template <typename Target>
898class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo
899 : public OSTargetInfo<Target> {
900protected:
901 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
902 MacroBuilder &Builder) const override {
903 // A common platform macro.
904 if (Opts.POSIXThreads)
905 Builder.defineMacro("_REENTRANT");
906 // Follow g++ convention and predefine _GNU_SOURCE for C++.
907 if (Opts.CPlusPlus)
908 Builder.defineMacro("_GNU_SOURCE");
909 // Indicate that we have __float128.
910 Builder.defineMacro("__FLOAT128__");
911 }
912
913public:
914 explicit WebAssemblyOSTargetInfo(const llvm::Triple &Triple,
915 const TargetOptions &Opts)
916 : OSTargetInfo<Target>(Triple, Opts) {
917 this->MCountName = "__mcount";
918 this->TheCXXABI.set(TargetCXXABI::WebAssembly);
919 this->HasFloat128 = true;
920 }
921};
922
923// WASI target
924template <typename Target>
925class LLVM_LIBRARY_VISIBILITY WASITargetInfo
926 : public WebAssemblyOSTargetInfo<Target> {
927 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
928 MacroBuilder &Builder) const final {
930 Builder.defineMacro("__wasi__");
931 }
932
933public:
934 using WebAssemblyOSTargetInfo<Target>::WebAssemblyOSTargetInfo;
935};
936
937// Emscripten target
938template <typename Target>
939class LLVM_LIBRARY_VISIBILITY EmscriptenTargetInfo
940 : public WebAssemblyOSTargetInfo<Target> {
941 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
942 MacroBuilder &Builder) const final {
944 DefineStd(Builder, "unix", Opts);
945 Builder.defineMacro("__EMSCRIPTEN__");
946 if (Opts.POSIXThreads)
947 Builder.defineMacro("__EMSCRIPTEN_PTHREADS__");
948 }
949
950public:
951 explicit EmscriptenTargetInfo(const llvm::Triple &Triple,
952 const TargetOptions &Opts)
953 : WebAssemblyOSTargetInfo<Target>(Triple, Opts) {
954 // Keeping the alignment of long double to 8 bytes even though its size is
955 // 16 bytes allows emscripten to have an 8-byte-aligned max_align_t which
956 // in turn gives is a 8-byte aligned malloc.
957 // Emscripten's ABI is unstable and we may change this back to 128 to match
958 // the WebAssembly default in the future.
959 this->LongDoubleAlign = 64;
960 }
961};
962
963// OHOS target
964template <typename Target>
965class LLVM_LIBRARY_VISIBILITY OHOSTargetInfo : public OSTargetInfo<Target> {
966protected:
967 void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
968 MacroBuilder &Builder) const override {
969 // Linux defines; list based off of gcc output
970 DefineStd(Builder, "unix", Opts);
971
972 // Generic OHOS target defines
973 if (Triple.isOHOSFamily()) {
974 Builder.defineMacro("__OHOS_FAMILY__", "1");
975
976 auto Version = Triple.getEnvironmentVersion();
977 this->PlatformName = "ohos";
978 this->PlatformMinVersion = Version;
979 Builder.defineMacro("__OHOS_Major__", Twine(Version.getMajor()));
980 if (auto Minor = Version.getMinor())
981 Builder.defineMacro("__OHOS_Minor__", Twine(*Minor));
982 if (auto Subminor = Version.getSubminor())
983 Builder.defineMacro("__OHOS_Micro__", Twine(*Subminor));
984 }
985
986 if (Triple.isOpenHOS())
987 Builder.defineMacro("__OHOS__");
988
989 if (Triple.isOSLinux()) {
990 DefineStd(Builder, "linux", Opts);
991 } else if (Triple.isOSLiteOS()) {
992 Builder.defineMacro("__LITEOS__");
993 }
994
995 if (Opts.POSIXThreads)
996 Builder.defineMacro("_REENTRANT");
997 if (Opts.CPlusPlus)
998 Builder.defineMacro("_GNU_SOURCE");
999 if (this->HasFloat128)
1000 Builder.defineMacro("__FLOAT128__");
1001 }
1002
1003public:
1004 OHOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
1005 : OSTargetInfo<Target>(Triple, Opts) {
1006 this->WIntType = TargetInfo::UnsignedInt;
1007
1008 switch (Triple.getArch()) {
1009 default:
1010 break;
1011 case llvm::Triple::x86:
1012 case llvm::Triple::x86_64:
1013 this->HasFloat128 = true;
1014 break;
1015 }
1016 }
1017
1018 const char *getStaticInitSectionSpecifier() const override {
1019 return ".text.startup";
1020 }
1021};
1022
1023} // namespace targets
1024} // namespace clang
1025#endif // LLVM_CLANG_LIB_BASIC_TARGETS_OSTARGETS_H
llvm::MachO::Target Target
Definition: MachO.h:51
#define FREEBSD_CC_VERSION
Definition: OSTargets.h:172
FPEvalMethodKind
Possible float expression evaluation method choices.
Definition: LangOptions.h:299
@ FEM_Double
Use the type double for fp arithmetic.
Definition: LangOptions.h:306
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:499
Options for controlling the target.
Definition: TargetOptions.h:26
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:713
bool defaultsToAIXPowerAlignment() const override
Definition: OSTargets.h:731
LangOptions::FPEvalMethodKind getFPEvalMethod() const override
Definition: OSTargets.h:727
bool areDefaultedSMFStillPOD(const LangOptions &) const override
Definition: OSTargets.h:733
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:648
bool areDefaultedSMFStillPOD(const LangOptions &) const override
Definition: OSTargets.h:135
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:44
unsigned getExnObjectAlignment() const override
Definition: OSTargets.h:93
TargetInfo::IntType getLeastIntTypeByWidth(unsigned BitWidth, bool IsSigned) const final
Definition: OSTargets.h:126
DarwinTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:51
bool hasProtectedVisibility() const override
Darwin does not support protected visibility.
Definition: OSTargets.h:91
const char * getStaticInitSectionSpecifier() const override
Definition: OSTargets.h:83
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:145
DragonFlyBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:158
EmscriptenTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:951
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:179
FreeBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:210
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:874
FuchsiaTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:888
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:266
HaikuTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:276
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:297
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:245
LinuxTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:350
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:318
const char * getStaticInitSectionSpecifier() const override
Definition: OSTargets.h:374
NaClTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:838
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:826
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:383
NetBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:395
const char * getStaticInitSectionSpecifier() const override
Definition: OSTargets.h:1018
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:967
OHOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:1004
virtual void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const =0
void getTargetDefines(const LangOptions &Opts, MacroBuilder &Builder) const override
Definition: OSTargets.h:30
OSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:27
OpenBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:429
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:413
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:461
PS3PPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:472
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:530
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:546
bool areDefaultedSMFStillPOD(const LangOptions &) const override
Definition: OSTargets.h:521
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:487
TargetInfo::CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Definition: OSTargets.h:517
PSOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:499
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:562
RTEMSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:572
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:597
SolarisTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:626
UEFITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:796
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:792
WebAssemblyOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:914
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:901
WindowsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:816
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:810
bool areDefaultedSMFStillPOD(const LangOptions &) const override
Definition: OSTargets.h:783
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:742
ZOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:772
void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts, MacroBuilder &Builder)
Definition: OSTargets.cpp:262
LLVM_LIBRARY_VISIBILITY void DefineStd(clang::MacroBuilder &Builder, llvm::StringRef MacroName, const clang::LangOptions &Opts)
Define a macro name and standard variants.
void getDarwinDefines(MacroBuilder &Builder, const LangOptions &Opts, const llvm::Triple &Triple, StringRef &PlatformName, VersionTuple &PlatformMinVersion)
Definition: OSTargets.cpp:22
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:278
@ CC_C
Definition: Specifiers.h:279
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Definition: TargetInfo.h:144