Coverage Report

Created: 2021-08-24 07:12

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/APINotes/APINotesTypes.cpp
Line
Count
Source (jump to first uncovered line)
1
//===-- APINotesTypes.cpp - API Notes Data Types ----------------*- 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
#include "clang/APINotes/Types.h"
10
#include "llvm/Support/raw_ostream.h"
11
12
namespace clang {
13
namespace api_notes {
14
0
LLVM_DUMP_METHOD void CommonEntityInfo::dump(llvm::raw_ostream &OS) const {
15
0
  if (Unavailable)
16
0
    OS << "[Unavailable] (" << UnavailableMsg << ")" << ' ';
17
0
  if (UnavailableInSwift)
18
0
    OS << "[UnavailableInSwift] ";
19
0
  if (SwiftPrivateSpecified)
20
0
    OS << (SwiftPrivate ? "[SwiftPrivate] " : "");
21
0
  if (!SwiftName.empty())
22
0
    OS << "Swift Name: " << SwiftName << ' ';
23
0
  OS << '\n';
24
0
}
25
26
0
LLVM_DUMP_METHOD void CommonTypeInfo::dump(llvm::raw_ostream &OS) const {
27
0
  static_cast<const CommonEntityInfo &>(*this).dump(OS);
28
0
  if (SwiftBridge)
29
0
    OS << "Swift Briged Type: " << *SwiftBridge << ' ';
30
0
  if (NSErrorDomain)
31
0
    OS << "NSError Domain: " << *NSErrorDomain << ' ';
32
0
  OS << '\n';
33
0
}
34
35
0
LLVM_DUMP_METHOD void ObjCContextInfo::dump(llvm::raw_ostream &OS) {
36
0
  static_cast<CommonTypeInfo &>(*this).dump(OS);
37
0
  if (HasDefaultNullability)
38
0
    OS << "DefaultNullability: " << DefaultNullability << ' ';
39
0
  if (HasDesignatedInits)
40
0
    OS << "[HasDesignatedInits] ";
41
0
  if (SwiftImportAsNonGenericSpecified)
42
0
    OS << (SwiftImportAsNonGeneric ? "[SwiftImportAsNonGeneric] " : "");
43
0
  if (SwiftObjCMembersSpecified)
44
0
    OS << (SwiftObjCMembers ? "[SwiftObjCMembers] " : "");
45
0
  OS << '\n';
46
0
}
47
48
0
LLVM_DUMP_METHOD void VariableInfo::dump(llvm::raw_ostream &OS) const {
49
0
  static_cast<const CommonEntityInfo &>(*this).dump(OS);
50
0
  if (NullabilityAudited)
51
0
    OS << "Audited Nullability: " << Nullable << ' ';
52
0
  if (!Type.empty())
53
0
    OS << "C Type: " << Type << ' ';
54
0
  OS << '\n';
55
0
}
56
57
0
LLVM_DUMP_METHOD void ObjCPropertyInfo::dump(llvm::raw_ostream &OS) const {
58
0
  static_cast<const VariableInfo &>(*this).dump(OS);
59
0
  if (SwiftImportAsAccessorsSpecified)
60
0
    OS << (SwiftImportAsAccessors ? "[SwiftImportAsAccessors] " : "");
61
0
  OS << '\n';
62
0
}
63
64
0
LLVM_DUMP_METHOD void ParamInfo::dump(llvm::raw_ostream &OS) const {
65
0
  static_cast<const VariableInfo &>(*this).dump(OS);
66
0
  if (NoEscapeSpecified)
67
0
    OS << (NoEscape ? "[NoEscape] " : "");
68
0
  OS << "RawRetainCountConvention: " << RawRetainCountConvention << ' ';
69
0
  OS << '\n';
70
0
}
71
72
0
LLVM_DUMP_METHOD void FunctionInfo::dump(llvm::raw_ostream &OS) const {
73
0
  static_cast<const CommonEntityInfo &>(*this).dump(OS);
74
0
  OS << (NullabilityAudited ? "[NullabilityAudited] " : "")
75
0
     << "RawRetainCountConvention: " << RawRetainCountConvention << ' ';
76
0
  if (!ResultType.empty())
77
0
    OS << "Result Type: " << ResultType << ' ';
78
0
  if (!Params.empty())
79
0
    OS << '\n';
80
0
  for (auto &PI : Params)
81
0
    PI.dump(OS);
82
0
}
83
84
0
LLVM_DUMP_METHOD void ObjCMethodInfo::dump(llvm::raw_ostream &OS) {
85
0
  static_cast<FunctionInfo &>(*this).dump(OS);
86
0
  OS << (DesignatedInit ? "[DesignatedInit] " : "")
87
0
     << (RequiredInit ? "[RequiredInit] " : "") << '\n';
88
0
}
89
90
0
LLVM_DUMP_METHOD void TagInfo::dump(llvm::raw_ostream &OS) {
91
0
  static_cast<CommonTypeInfo &>(*this).dump(OS);
92
0
  if (HasFlagEnum)
93
0
    OS << (IsFlagEnum ? "[FlagEnum] " : "");
94
0
  if (EnumExtensibility)
95
0
    OS << "Enum Extensibility: " << static_cast<long>(*EnumExtensibility)
96
0
       << ' ';
97
0
  OS << '\n';
98
0
}
99
100
0
LLVM_DUMP_METHOD void TypedefInfo::dump(llvm::raw_ostream &OS) const {
101
0
  static_cast<const CommonTypeInfo &>(*this).dump(OS);
102
0
  if (SwiftWrapper)
103
0
    OS << "Swift Type: " << static_cast<long>(*SwiftWrapper) << ' ';
104
0
  OS << '\n';
105
0
}
106
} // namespace api_notes
107
} // namespace clang