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