Coverage Report

Created: 2019-07-24 05:18

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