Coverage Report

Created: 2021-08-24 07:12

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