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