clang  14.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  }
112 
113  this->MCountName = "\01mcount";
114  }
115 
116  const char *getStaticInitSectionSpecifier() const override {
117  // FIXME: We should return 0 when building kexts.
118  return "__TEXT,__StaticInit,regular,pure_instructions";
119  }
120 
121  /// Darwin does not support protected visibility. Darwin's "default"
122  /// is very similar to ELF's "protected"; Darwin requires a "weak"
123  /// attribute on declarations that can be dynamically replaced.
124  bool hasProtectedVisibility() const override { return false; }
125 
126  unsigned getExnObjectAlignment() const override {
127  // Older versions of libc++abi guarantee an alignment of only 8-bytes for
128  // exception objects because of a bug in __cxa_exception that was
129  // eventually fixed in r319123.
130  llvm::VersionTuple MinVersion;
131  const llvm::Triple &T = this->getTriple();
132 
133  // Compute the earliest OS versions that have the fix to libc++abi.
134  switch (T.getOS()) {
135  case llvm::Triple::Darwin:
136  case llvm::Triple::MacOSX: // Earliest supporting version is 10.14.
137  MinVersion = llvm::VersionTuple(10U, 14U);
138  break;
139  case llvm::Triple::IOS:
140  case llvm::Triple::TvOS: // Earliest supporting version is 12.0.0.
141  MinVersion = llvm::VersionTuple(12U);
142  break;
143  case llvm::Triple::WatchOS: // Earliest supporting version is 5.0.0.
144  MinVersion = llvm::VersionTuple(5U);
145  break;
146  default:
147  // Conservatively return 8 bytes if OS is unknown.
148  return 64;
149  }
150 
151  unsigned Major, Minor, Micro;
152  T.getOSVersion(Major, Minor, Micro);
153  if (llvm::VersionTuple(Major, Minor, Micro) < 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  unsigned Maj, Min, Rev;
380  Triple.getEnvironmentVersion(Maj, Min, Rev);
381  this->PlatformName = "android";
382  this->PlatformMinVersion = VersionTuple(Maj, Min, Rev);
383  if (Maj) {
384  Builder.defineMacro("__ANDROID_MIN_SDK_VERSION__", Twine(Maj));
385  // This historical but ambiguous name for the minSdkVersion macro. Keep
386  // defined for compatibility.
387  Builder.defineMacro("__ANDROID_API__", "__ANDROID_MIN_SDK_VERSION__");
388  }
389  } else {
390  Builder.defineMacro("__gnu_linux__");
391  }
392  if (Opts.POSIXThreads)
393  Builder.defineMacro("_REENTRANT");
394  if (Opts.CPlusPlus)
395  Builder.defineMacro("_GNU_SOURCE");
396  if (this->HasFloat128)
397  Builder.defineMacro("__FLOAT128__");
398  }
399 
400 public:
401  LinuxTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
402  : OSTargetInfo<Target>(Triple, Opts) {
403  this->WIntType = TargetInfo::UnsignedInt;
404 
405  switch (Triple.getArch()) {
406  default:
407  break;
408  case llvm::Triple::mips:
409  case llvm::Triple::mipsel:
410  case llvm::Triple::mips64:
411  case llvm::Triple::mips64el:
412  case llvm::Triple::ppc:
413  case llvm::Triple::ppcle:
414  case llvm::Triple::ppc64:
415  case llvm::Triple::ppc64le:
416  this->MCountName = "_mcount";
417  break;
418  case llvm::Triple::x86:
419  case llvm::Triple::x86_64:
420  this->HasFloat128 = true;
421  break;
422  }
423  }
424 
425  const char *getStaticInitSectionSpecifier() const override {
426  return ".text.startup";
427  }
428 };
429 
430 // NetBSD Target
431 template <typename Target>
432 class LLVM_LIBRARY_VISIBILITY NetBSDTargetInfo : public OSTargetInfo<Target> {
433 protected:
434  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
435  MacroBuilder &Builder) const override {
436  // NetBSD defines; list based off of gcc output
437  Builder.defineMacro("__NetBSD__");
438  Builder.defineMacro("__unix__");
439  Builder.defineMacro("__ELF__");
440  if (Opts.POSIXThreads)
441  Builder.defineMacro("_REENTRANT");
442  }
443 
444 public:
445  NetBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
446  : OSTargetInfo<Target>(Triple, Opts) {
447  this->MCountName = "__mcount";
448  }
449 };
450 
451 // OpenBSD Target
452 template <typename Target>
453 class LLVM_LIBRARY_VISIBILITY OpenBSDTargetInfo : public OSTargetInfo<Target> {
454 protected:
455  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
456  MacroBuilder &Builder) const override {
457  // OpenBSD defines; list based off of gcc output
458 
459  Builder.defineMacro("__OpenBSD__");
460  DefineStd(Builder, "unix", Opts);
461  Builder.defineMacro("__ELF__");
462  if (Opts.POSIXThreads)
463  Builder.defineMacro("_REENTRANT");
464  if (this->HasFloat128)
465  Builder.defineMacro("__FLOAT128__");
466 
467  if (Opts.C11) {
468  Builder.defineMacro("__STDC_NO_ATOMICS__");
469  Builder.defineMacro("__STDC_NO_THREADS__");
470  }
471  }
472 
473 public:
474  OpenBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
475  : OSTargetInfo<Target>(Triple, Opts) {
476  this->WCharType = this->WIntType = this->SignedInt;
477  this->IntMaxType = TargetInfo::SignedLongLong;
478  this->Int64Type = TargetInfo::SignedLongLong;
479  switch (Triple.getArch()) {
480  case llvm::Triple::x86:
481  case llvm::Triple::x86_64:
482  this->HasFloat128 = true;
483  LLVM_FALLTHROUGH;
484  default:
485  this->MCountName = "__mcount";
486  break;
487  case llvm::Triple::mips64:
488  case llvm::Triple::mips64el:
489  case llvm::Triple::ppc:
490  case llvm::Triple::ppc64:
491  case llvm::Triple::ppc64le:
492  case llvm::Triple::sparcv9:
493  this->MCountName = "_mcount";
494  break;
495  case llvm::Triple::riscv32:
496  case llvm::Triple::riscv64:
497  break;
498  }
499  }
500 };
501 
502 // PSP Target
503 template <typename Target>
504 class LLVM_LIBRARY_VISIBILITY PSPTargetInfo : public OSTargetInfo<Target> {
505 protected:
506  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
507  MacroBuilder &Builder) const override {
508  // PSP defines; list based on the output of the pspdev gcc toolchain.
509  Builder.defineMacro("PSP");
510  Builder.defineMacro("_PSP");
511  Builder.defineMacro("__psp__");
512  Builder.defineMacro("__ELF__");
513  }
514 
515 public:
516  PSPTargetInfo(const llvm::Triple &Triple) : OSTargetInfo<Target>(Triple) {}
517 };
518 
519 // PS3 PPU Target
520 template <typename Target>
521 class LLVM_LIBRARY_VISIBILITY PS3PPUTargetInfo : public OSTargetInfo<Target> {
522 protected:
523  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
524  MacroBuilder &Builder) const override {
525  // PS3 PPU defines.
526  Builder.defineMacro("__PPC__");
527  Builder.defineMacro("__PPU__");
528  Builder.defineMacro("__CELLOS_LV2__");
529  Builder.defineMacro("__ELF__");
530  Builder.defineMacro("__LP32__");
531  Builder.defineMacro("_ARCH_PPC64");
532  Builder.defineMacro("__powerpc64__");
533  }
534 
535 public:
536  PS3PPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
537  : OSTargetInfo<Target>(Triple, Opts) {
538  this->LongWidth = this->LongAlign = 32;
539  this->PointerWidth = this->PointerAlign = 32;
540  this->IntMaxType = TargetInfo::SignedLongLong;
541  this->Int64Type = TargetInfo::SignedLongLong;
542  this->SizeType = TargetInfo::UnsignedInt;
543  this->resetDataLayout("E-m:e-p:32:32-i64:64-n32:64");
544  }
545 };
546 
547 template <typename Target>
548 class LLVM_LIBRARY_VISIBILITY PS4OSTargetInfo : public OSTargetInfo<Target> {
549 protected:
550  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
551  MacroBuilder &Builder) const override {
552  Builder.defineMacro("__FreeBSD__", "9");
553  Builder.defineMacro("__FreeBSD_cc_version", "900001");
554  Builder.defineMacro("__KPRINTF_ATTRIBUTE__");
555  DefineStd(Builder, "unix", Opts);
556  Builder.defineMacro("__ELF__");
557  Builder.defineMacro("__SCE__");
558  Builder.defineMacro("__ORBIS__");
559  }
560 
561 public:
562  PS4OSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
563  : OSTargetInfo<Target>(Triple, Opts) {
564  this->WCharType = TargetInfo::UnsignedShort;
565 
566  // On PS4, TLS variable cannot be aligned to more than 32 bytes (256 bits).
567  this->MaxTLSAlign = 256;
568 
569  // On PS4, do not honor explicit bit field alignment,
570  // as in "__attribute__((aligned(2))) int b : 1;".
571  this->UseExplicitBitFieldAlignment = false;
572 
573  switch (Triple.getArch()) {
574  default:
575  case llvm::Triple::x86_64:
576  this->MCountName = ".mcount";
577  this->NewAlign = 256;
578  break;
579  }
580  }
582  checkCallingConvention(CallingConv CC) const override {
584  }
585 };
586 
587 // RTEMS Target
588 template <typename Target>
589 class LLVM_LIBRARY_VISIBILITY RTEMSTargetInfo : public OSTargetInfo<Target> {
590 protected:
591  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
592  MacroBuilder &Builder) const override {
593  // RTEMS defines; list based off of gcc output
594 
595  Builder.defineMacro("__rtems__");
596  Builder.defineMacro("__ELF__");
597  if (Opts.CPlusPlus)
598  Builder.defineMacro("_GNU_SOURCE");
599  }
600 
601 public:
602  RTEMSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
603  : OSTargetInfo<Target>(Triple, Opts) {
604  switch (Triple.getArch()) {
605  default:
606  case llvm::Triple::x86:
607  // this->MCountName = ".mcount";
608  break;
609  case llvm::Triple::mips:
610  case llvm::Triple::mipsel:
611  case llvm::Triple::ppc:
612  case llvm::Triple::ppc64:
613  case llvm::Triple::ppc64le:
614  // this->MCountName = "_mcount";
615  break;
616  case llvm::Triple::arm:
617  // this->MCountName = "__mcount";
618  break;
619  }
620  }
621 };
622 
623 // Solaris target
624 template <typename Target>
625 class LLVM_LIBRARY_VISIBILITY SolarisTargetInfo : public OSTargetInfo<Target> {
626 protected:
627  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
628  MacroBuilder &Builder) const override {
629  DefineStd(Builder, "sun", Opts);
630  DefineStd(Builder, "unix", Opts);
631  Builder.defineMacro("__ELF__");
632  Builder.defineMacro("__svr4__");
633  Builder.defineMacro("__SVR4");
634  // Solaris headers require _XOPEN_SOURCE to be set to 600 for C99 and
635  // newer, but to 500 for everything else. feature_test.h has a check to
636  // ensure that you are not using C99 with an old version of X/Open or C89
637  // with a new version.
638  if (Opts.C99)
639  Builder.defineMacro("_XOPEN_SOURCE", "600");
640  else
641  Builder.defineMacro("_XOPEN_SOURCE", "500");
642  if (Opts.CPlusPlus) {
643  Builder.defineMacro("__C99FEATURES__");
644  Builder.defineMacro("_FILE_OFFSET_BITS", "64");
645  }
646  // GCC restricts the next two to C++.
647  Builder.defineMacro("_LARGEFILE_SOURCE");
648  Builder.defineMacro("_LARGEFILE64_SOURCE");
649  Builder.defineMacro("__EXTENSIONS__");
650  if (Opts.POSIXThreads)
651  Builder.defineMacro("_REENTRANT");
652  if (this->HasFloat128)
653  Builder.defineMacro("__FLOAT128__");
654  }
655 
656 public:
657  SolarisTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
658  : OSTargetInfo<Target>(Triple, Opts) {
659  if (this->PointerWidth == 64) {
660  this->WCharType = this->WIntType = this->SignedInt;
661  } else {
662  this->WCharType = this->WIntType = this->SignedLong;
663  }
664  switch (Triple.getArch()) {
665  default:
666  break;
667  case llvm::Triple::x86:
668  case llvm::Triple::x86_64:
669  this->HasFloat128 = true;
670  break;
671  }
672  }
673 };
674 
675 // AIX Target
676 template <typename Target>
677 class AIXTargetInfo : public OSTargetInfo<Target> {
678 protected:
679  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
680  MacroBuilder &Builder) const override {
681  DefineStd(Builder, "unix", Opts);
682  Builder.defineMacro("_IBMR2");
683  Builder.defineMacro("_POWER");
684  Builder.defineMacro("__THW_BIG_ENDIAN__");
685 
686  Builder.defineMacro("_AIX");
687  Builder.defineMacro("__TOS_AIX__");
688  Builder.defineMacro("__HOS_AIX__");
689 
690  if (Opts.C11) {
691  Builder.defineMacro("__STDC_NO_ATOMICS__");
692  Builder.defineMacro("__STDC_NO_THREADS__");
693  }
694 
695  if (Opts.EnableAIXExtendedAltivecABI)
696  Builder.defineMacro("__EXTABI__");
697 
698  unsigned Major, Minor, Micro;
699  Triple.getOSVersion(Major, Minor, Micro);
700 
701  // Define AIX OS-Version Macros.
702  // Includes logic for legacy versions of AIX; no specific intent to support.
703  std::pair<int, int> OsVersion = {Major, Minor};
704  if (OsVersion >= std::make_pair(3, 2)) Builder.defineMacro("_AIX32");
705  if (OsVersion >= std::make_pair(4, 1)) Builder.defineMacro("_AIX41");
706  if (OsVersion >= std::make_pair(4, 3)) Builder.defineMacro("_AIX43");
707  if (OsVersion >= std::make_pair(5, 0)) Builder.defineMacro("_AIX50");
708  if (OsVersion >= std::make_pair(5, 1)) Builder.defineMacro("_AIX51");
709  if (OsVersion >= std::make_pair(5, 2)) Builder.defineMacro("_AIX52");
710  if (OsVersion >= std::make_pair(5, 3)) Builder.defineMacro("_AIX53");
711  if (OsVersion >= std::make_pair(6, 1)) Builder.defineMacro("_AIX61");
712  if (OsVersion >= std::make_pair(7, 1)) Builder.defineMacro("_AIX71");
713  if (OsVersion >= std::make_pair(7, 2)) Builder.defineMacro("_AIX72");
714  if (OsVersion >= std::make_pair(7, 3)) Builder.defineMacro("_AIX73");
715 
716  // FIXME: Do not define _LONG_LONG when -fno-long-long is specified.
717  Builder.defineMacro("_LONG_LONG");
718 
719  if (Opts.POSIXThreads) {
720  Builder.defineMacro("_THREAD_SAFE");
721  }
722 
723  if (this->PointerWidth == 64) {
724  Builder.defineMacro("__64BIT__");
725  }
726 
727  // Define _WCHAR_T when it is a fundamental type
728  // (i.e., for C++ without -fno-wchar).
729  if (Opts.CPlusPlus && Opts.WChar) {
730  Builder.defineMacro("_WCHAR_T");
731  }
732  }
733 
734 public:
735  AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
736  : OSTargetInfo<Target>(Triple, Opts) {
737  this->TheCXXABI.set(TargetCXXABI::XL);
738 
739  if (this->PointerWidth == 64) {
740  this->WCharType = this->UnsignedInt;
741  } else {
742  this->WCharType = this->UnsignedShort;
743  }
744  this->UseZeroLengthBitfieldAlignment = true;
745  }
746 
747  // AIX sets FLT_EVAL_METHOD to be 1.
748  unsigned getFloatEvalMethod() const override { return 1; }
749 
750  bool defaultsToAIXPowerAlignment() const override { return true; }
751 };
752 
753 // z/OS target
754 template <typename Target>
755 class LLVM_LIBRARY_VISIBILITY ZOSTargetInfo : public OSTargetInfo<Target> {
756 protected:
757  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
758  MacroBuilder &Builder) const override {
759  // FIXME: _LONG_LONG should not be defined under -std=c89.
760  Builder.defineMacro("_LONG_LONG");
761  Builder.defineMacro("_OPEN_DEFAULT");
762  // _UNIX03_WITHDRAWN is required to build libcxx.
763  Builder.defineMacro("_UNIX03_WITHDRAWN");
764  Builder.defineMacro("__370__");
765  Builder.defineMacro("__BFP__");
766  // FIXME: __BOOL__ should not be defined under -std=c89.
767  Builder.defineMacro("__BOOL__");
768  Builder.defineMacro("__LONGNAME__");
769  Builder.defineMacro("__MVS__");
770  Builder.defineMacro("__THW_370__");
771  Builder.defineMacro("__THW_BIG_ENDIAN__");
772  Builder.defineMacro("__TOS_390__");
773  Builder.defineMacro("__TOS_MVS__");
774  Builder.defineMacro("__XPLINK__");
775 
776  if (this->PointerWidth == 64)
777  Builder.defineMacro("__64BIT__");
778 
779  if (Opts.CPlusPlus) {
780  Builder.defineMacro("__DLL__");
781  // _XOPEN_SOURCE=600 is required to build libcxx.
782  Builder.defineMacro("_XOPEN_SOURCE", "600");
783  }
784 
785  if (Opts.GNUMode) {
786  Builder.defineMacro("_MI_BUILTIN");
787  Builder.defineMacro("_EXT");
788  }
789 
790  if (Opts.CPlusPlus && Opts.WChar) {
791  // Macro __wchar_t is defined so that the wchar_t data
792  // type is not declared as a typedef in system headers.
793  Builder.defineMacro("__wchar_t");
794  }
795 
796  this->PlatformName = llvm::Triple::getOSTypeName(Triple.getOS());
797  }
798 
799 public:
800  ZOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
801  : OSTargetInfo<Target>(Triple, Opts) {
802  this->WCharType = TargetInfo::UnsignedInt;
803  this->MaxAlignedAttribute = 128;
804  this->UseBitFieldTypeAlignment = false;
805  this->UseZeroLengthBitfieldAlignment = true;
806  this->UseLeadingZeroLengthBitfield = false;
807  this->ZeroLengthBitfieldBoundary = 32;
808  }
809 };
810 
811 void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts,
812  MacroBuilder &Builder);
813 
814 // Windows target
815 template <typename Target>
816 class LLVM_LIBRARY_VISIBILITY WindowsTargetInfo : public OSTargetInfo<Target> {
817 protected:
818  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
819  MacroBuilder &Builder) const override {
820  addWindowsDefines(Triple, Opts, Builder);
821  }
822 
823 public:
824  WindowsTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
825  : OSTargetInfo<Target>(Triple, Opts) {
826  this->WCharType = TargetInfo::UnsignedShort;
827  this->WIntType = TargetInfo::UnsignedShort;
828  }
829 };
830 
831 template <typename Target>
832 class LLVM_LIBRARY_VISIBILITY NaClTargetInfo : public OSTargetInfo<Target> {
833 protected:
834  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
835  MacroBuilder &Builder) const override {
836  if (Opts.POSIXThreads)
837  Builder.defineMacro("_REENTRANT");
838  if (Opts.CPlusPlus)
839  Builder.defineMacro("_GNU_SOURCE");
840 
841  DefineStd(Builder, "unix", Opts);
842  Builder.defineMacro("__ELF__");
843  Builder.defineMacro("__native_client__");
844  }
845 
846 public:
847  NaClTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
848  : OSTargetInfo<Target>(Triple, Opts) {
849  this->LongAlign = 32;
850  this->LongWidth = 32;
851  this->PointerAlign = 32;
852  this->PointerWidth = 32;
853  this->IntMaxType = TargetInfo::SignedLongLong;
854  this->Int64Type = TargetInfo::SignedLongLong;
855  this->DoubleAlign = 64;
856  this->LongDoubleWidth = 64;
857  this->LongDoubleAlign = 64;
858  this->LongLongWidth = 64;
859  this->LongLongAlign = 64;
860  this->SizeType = TargetInfo::UnsignedInt;
861  this->PtrDiffType = TargetInfo::SignedInt;
862  this->IntPtrType = TargetInfo::SignedInt;
863  // RegParmMax is inherited from the underlying architecture.
864  this->LongDoubleFormat = &llvm::APFloat::IEEEdouble();
865  if (Triple.getArch() == llvm::Triple::arm) {
866  // Handled in ARM's setABI().
867  } else if (Triple.getArch() == llvm::Triple::x86) {
868  this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
869  "i64:64-n8:16:32-S128");
870  } else if (Triple.getArch() == llvm::Triple::x86_64) {
871  this->resetDataLayout("e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-"
872  "i64:64-n8:16:32:64-S128");
873  } else if (Triple.getArch() == llvm::Triple::mipsel) {
874  // Handled on mips' setDataLayout.
875  } else {
876  assert(Triple.getArch() == llvm::Triple::le32);
877  this->resetDataLayout("e-p:32:32-i64:64");
878  }
879  }
880 };
881 
882 // Fuchsia Target
883 template <typename Target>
884 class LLVM_LIBRARY_VISIBILITY FuchsiaTargetInfo : public OSTargetInfo<Target> {
885 protected:
886  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
887  MacroBuilder &Builder) const override {
888  Builder.defineMacro("__Fuchsia__");
889  Builder.defineMacro("__ELF__");
890  if (Opts.POSIXThreads)
891  Builder.defineMacro("_REENTRANT");
892  // Required by the libc++ locale support.
893  if (Opts.CPlusPlus)
894  Builder.defineMacro("_GNU_SOURCE");
895  Builder.defineMacro("__Fuchsia_API_level__", Twine(Opts.FuchsiaAPILevel));
896  this->PlatformName = "fuchsia";
897  this->PlatformMinVersion = VersionTuple(Opts.FuchsiaAPILevel);
898  }
899 
900 public:
901  FuchsiaTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
902  : OSTargetInfo<Target>(Triple, Opts) {
903  this->MCountName = "__mcount";
904  this->TheCXXABI.set(TargetCXXABI::Fuchsia);
905  }
906 };
907 
908 // WebAssembly target
909 template <typename Target>
910 class LLVM_LIBRARY_VISIBILITY WebAssemblyOSTargetInfo
911  : public OSTargetInfo<Target> {
912 protected:
913  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
914  MacroBuilder &Builder) const override {
915  // A common platform macro.
916  if (Opts.POSIXThreads)
917  Builder.defineMacro("_REENTRANT");
918  // Follow g++ convention and predefine _GNU_SOURCE for C++.
919  if (Opts.CPlusPlus)
920  Builder.defineMacro("_GNU_SOURCE");
921  // Indicate that we have __float128.
922  Builder.defineMacro("__FLOAT128__");
923  }
924 
925 public:
926  explicit WebAssemblyOSTargetInfo(const llvm::Triple &Triple,
927  const TargetOptions &Opts)
928  : OSTargetInfo<Target>(Triple, Opts) {
929  this->MCountName = "__mcount";
930  this->TheCXXABI.set(TargetCXXABI::WebAssembly);
931  this->HasFloat128 = true;
932  }
933 };
934 
935 // WASI target
936 template <typename Target>
937 class LLVM_LIBRARY_VISIBILITY WASITargetInfo
938  : public WebAssemblyOSTargetInfo<Target> {
939  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
940  MacroBuilder &Builder) const final {
941  WebAssemblyOSTargetInfo<Target>::getOSDefines(Opts, Triple, Builder);
942  Builder.defineMacro("__wasi__");
943  }
944 
945 public:
946  explicit WASITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
947  : WebAssemblyOSTargetInfo<Target>(Triple, Opts) {}
948 };
949 
950 // Emscripten target
951 template <typename Target>
952 class LLVM_LIBRARY_VISIBILITY EmscriptenTargetInfo
953  : public WebAssemblyOSTargetInfo<Target> {
954  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
955  MacroBuilder &Builder) const final {
956  WebAssemblyOSTargetInfo<Target>::getOSDefines(Opts, Triple, Builder);
957  DefineStd(Builder, "unix", Opts);
958  Builder.defineMacro("__EMSCRIPTEN__");
959  if (Opts.POSIXThreads)
960  Builder.defineMacro("__EMSCRIPTEN_PTHREADS__");
961  }
962 
963 public:
964  explicit EmscriptenTargetInfo(const llvm::Triple &Triple,
965  const TargetOptions &Opts)
966  : WebAssemblyOSTargetInfo<Target>(Triple, Opts) {
967  // Keeping the alignment of long double to 8 bytes even though its size is
968  // 16 bytes allows emscripten to have an 8-byte-aligned max_align_t which
969  // in turn gives is a 8-byte aligned malloc.
970  // Emscripten's ABI is unstable and we may change this back to 128 to match
971  // the WebAssembly default in the future.
972  this->LongDoubleAlign = 64;
973  }
974 };
975 
976 } // namespace targets
977 } // namespace clang
978 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_OSTARGETS_H
clang::targets::PS3PPUTargetInfo::PS3PPUTargetInfo
PS3PPUTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:536
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:657
clang::targets::DarwinTargetInfo::getStaticInitSectionSpecifier
const char * getStaticInitSectionSpecifier() const override
Definition: OSTargets.h:116
clang::targets::AIXTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:679
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:434
clang::targets::RTEMSTargetInfo
Definition: OSTargets.h:589
clang::targets::OpenBSDTargetInfo
Definition: OSTargets.h:453
clang::targets::WASITargetInfo::WASITargetInfo
WASITargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:946
clang::targets::WASITargetInfo
Definition: OSTargets.h:937
clang::targets::SolarisTargetInfo
Definition: OSTargets.h:625
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:832
clang::TransferrableTargetInfo::UnsignedShort
@ UnsignedShort
Definition: TargetInfo.h:124
clang::targets::WebAssemblyOSTargetInfo
Definition: OSTargets.h:910
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:602
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:474
clang::targets::LinuxTargetInfo::LinuxTargetInfo
LinuxTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:401
clang::TransferrableTargetInfo::UnsignedLongLong
@ UnsignedLongLong
Definition: TargetInfo.h:130
clang::targets::PSPTargetInfo::PSPTargetInfo
PSPTargetInfo(const llvm::Triple &Triple)
Definition: OSTargets.h:516
clang::targets::PSPTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:506
clang::targets::AIXTargetInfo::getFloatEvalMethod
unsigned getFloatEvalMethod() const override
Definition: OSTargets.h:748
clang::targets::DarwinTargetInfo::hasProtectedVisibility
bool hasProtectedVisibility() const override
Darwin does not support protected visibility.
Definition: OSTargets.h:124
clang::targets::LinuxTargetInfo::getStaticInitSectionSpecifier
const char * getStaticInitSectionSpecifier() const override
Definition: OSTargets.h:425
clang::targets::NetBSDTargetInfo
Definition: OSTargets.h:432
U
clang::targets::AIXTargetInfo::AIXTargetInfo
AIXTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:735
clang::targets::AnanasTargetInfo
Definition: OSTargets.h:59
clang::targets::KFreeBSDTargetInfo
Definition: OSTargets.h:266
clang::targets::WindowsTargetInfo
Definition: OSTargets.h:816
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:886
clang::targets::DarwinTargetInfo
Definition: OSTargets.h:78
clang::targets::FuchsiaTargetInfo
Definition: OSTargets.h:884
clang::targets::NaClTargetInfo::NaClTargetInfo
NaClTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:847
Targets.h
clang::targets::DefineStd
void DefineStd(MacroBuilder &Builder, StringRef MacroName, const LangOptions &Opts)
DefineStd - Define a macro name and standard variants.
Definition: Targets.cpp:56
clang::TargetInfo::CCCR_OK
@ CCCR_OK
Definition: TargetInfo.h:1460
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:627
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:267
clang::targets::WebAssemblyOSTargetInfo::WebAssemblyOSTargetInfo
WebAssemblyOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:926
clang::targets::FuchsiaTargetInfo::FuchsiaTargetInfo
FuchsiaTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:901
clang::targets::WindowsTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:818
clang::targets::ZOSTargetInfo::ZOSTargetInfo
ZOSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:800
clang::targets::NetBSDTargetInfo::NetBSDTargetInfo
NetBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:445
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:582
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:824
clang::targets::OSTargetInfo
Definition: OSTargets.h:21
clang::targets::ZOSTargetInfo
Definition: OSTargets.h:755
clang::targets::PS4OSTargetInfo
Definition: OSTargets.h:548
clang::targets::HaikuTargetInfo
Definition: OSTargets.h:289
clang::targets::PS4OSTargetInfo::PS4OSTargetInfo
PS4OSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:562
clang::targets::HaikuTargetInfo::HaikuTargetInfo
HaikuTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:302
clang::targets::PSPTargetInfo
Definition: OSTargets.h:504
clang::targets::OpenBSDTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:455
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:750
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:550
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:58
clang::targets::AIXTargetInfo
Definition: OSTargets.h:677
clang::TransferrableTargetInfo::IntType
IntType
===-— Target Data Type Query Methods ----------------------------—===//
Definition: TargetInfo.h:119
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:913
clang::targets::PS3PPUTargetInfo
Definition: OSTargets.h:521
clang::targets::EmscriptenTargetInfo
Definition: OSTargets.h:952
clang
Definition: CalledOnceCheck.h:17
clang::targets::LinuxTargetInfo
Definition: OSTargets.h:369
clang::TransferrableTargetInfo::SignedInt
@ SignedInt
Definition: TargetInfo.h:125
clang::TransferrableTargetInfo::UnsignedLong
@ UnsignedLong
Definition: TargetInfo.h:128
clang::TransferrableTargetInfo::SignedLongLong
@ SignedLongLong
Definition: TargetInfo.h:129
clang::TargetInfo::CCCR_Error
@ CCCR_Error
Definition: TargetInfo.h:1463
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:591
clang::targets::DragonFlyBSDTargetInfo::DragonFlyBSDTargetInfo
DragonFlyBSDTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:187
clang::targets::DragonFlyBSDTargetInfo
Definition: OSTargets.h:170
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:964
clang::targets::addWindowsDefines
void addWindowsDefines(const llvm::Triple &Triple, const LangOptions &Opts, MacroBuilder &Builder)
Definition: OSTargets.cpp:206
clang::TargetInfo::CallingConvCheckResult
CallingConvCheckResult
Definition: TargetInfo.h:1459
clang::MacroBuilder
Definition: MacroBuilder.h:23
clang::targets::DarwinTargetInfo::getExnObjectAlignment
unsigned getExnObjectAlignment() const override
Definition: OSTargets.h:126
clang::targets::MinixTargetInfo
Definition: OSTargets.h:345
clang::TransferrableTargetInfo::UnsignedInt
@ UnsignedInt
Definition: TargetInfo.h:126
clang::targets::ZOSTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:757
clang::targets::NaClTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:834
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:127
clang::targets::PS3PPUTargetInfo::getOSDefines
void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple, MacroBuilder &Builder) const override
Definition: OSTargets.h:523
clang::targets::OSTargetInfo::OSTargetInfo
OSTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts)
Definition: OSTargets.h:27