Coverage Report

Created: 2022-07-16 07:03

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