Coverage Report

Created: 2022-07-16 07:03

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/include/clang/Analysis/SelectorExtras.h
Line
Count
Source
1
//=== SelectorExtras.h - Helpers for checkers using selectors -----*- 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
#ifndef LLVM_CLANG_ANALYSIS_SELECTOREXTRAS_H
10
#define LLVM_CLANG_ANALYSIS_SELECTOREXTRAS_H
11
12
#include "clang/AST/ASTContext.h"
13
14
namespace clang {
15
16
template <typename... IdentifierInfos>
17
static inline Selector getKeywordSelector(ASTContext &Ctx,
18
733
                                          IdentifierInfos *... IIs) {
19
733
  static_assert(sizeof...(IdentifierInfos) > 0,
20
733
                "keyword selectors must have at least one argument");
21
733
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
733
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
733
}
BasicObjCFoundationChecks.cpp:clang::Selector clang::getKeywordSelector<char const>(clang::ASTContext&, char const*)
Line
Count
Source
18
45
                                          IdentifierInfos *... IIs) {
19
45
  static_assert(sizeof...(IdentifierInfos) > 0,
20
45
                "keyword selectors must have at least one argument");
21
45
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
45
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
45
}
BasicObjCFoundationChecks.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
25
                                          IdentifierInfos *... IIs) {
19
25
  static_assert(sizeof...(IdentifierInfos) > 0,
20
25
                "keyword selectors must have at least one argument");
21
25
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
25
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
25
}
BasicObjCFoundationChecks.cpp:clang::Selector clang::getKeywordSelector<char const, char const, char const>(clang::ASTContext&, char const*, char const*, char const*)
Line
Count
Source
18
4
                                          IdentifierInfos *... IIs) {
19
4
  static_assert(sizeof...(IdentifierInfos) > 0,
20
4
                "keyword selectors must have at least one argument");
21
4
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
4
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
4
}
BasicObjCFoundationChecks.cpp:clang::Selector clang::getKeywordSelector<char const, char const, char const, char const>(clang::ASTContext&, char const*, char const*, char const*, char const*)
Line
Count
Source
18
4
                                          IdentifierInfos *... IIs) {
19
4
  static_assert(sizeof...(IdentifierInfos) > 0,
20
4
                "keyword selectors must have at least one argument");
21
4
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
4
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
4
}
NoReturnFunctionChecker.cpp:clang::Selector clang::getKeywordSelector<char const, char const, char const, char const>(clang::ASTContext&, char const*, char const*, char const*, char const*)
Line
Count
Source
18
1
                                          IdentifierInfos *... IIs) {
19
1
  static_assert(sizeof...(IdentifierInfos) > 0,
20
1
                "keyword selectors must have at least one argument");
21
1
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
1
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
1
}
NoReturnFunctionChecker.cpp:clang::Selector clang::getKeywordSelector<char const, char const, char const, char const, char const>(clang::ASTContext&, char const*, char const*, char const*, char const*, char const*)
Line
Count
Source
18
1
                                          IdentifierInfos *... IIs) {
19
1
  static_assert(sizeof...(IdentifierInfos) > 0,
20
1
                "keyword selectors must have at least one argument");
21
1
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
1
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
1
}
TrustNonnullChecker.cpp:clang::Selector clang::getKeywordSelector<char const>(clang::ASTContext&, char const*)
Line
Count
Source
18
84
                                          IdentifierInfos *... IIs) {
19
84
  static_assert(sizeof...(IdentifierInfos) > 0,
20
84
                "keyword selectors must have at least one argument");
21
84
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
84
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
84
}
TrustNonnullChecker.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
84
                                          IdentifierInfos *... IIs) {
19
84
  static_assert(sizeof...(IdentifierInfos) > 0,
20
84
                "keyword selectors must have at least one argument");
21
84
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
84
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
84
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const>(clang::ASTContext&, char const*)
Line
Count
Source
18
194
                                          IdentifierInfos *... IIs) {
19
194
  static_assert(sizeof...(IdentifierInfos) > 0,
20
194
                "keyword selectors must have at least one argument");
21
194
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
194
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
194
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
194
                                          IdentifierInfos *... IIs) {
19
194
  static_assert(sizeof...(IdentifierInfos) > 0,
20
194
                "keyword selectors must have at least one argument");
21
194
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
194
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
194
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const, char const, char const, char const>(clang::ASTContext&, char const*, char const*, char const*, char const*)
Line
Count
Source
18
97
                                          IdentifierInfos *... IIs) {
19
97
  static_assert(sizeof...(IdentifierInfos) > 0,
20
97
                "keyword selectors must have at least one argument");
21
97
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
97
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
97
}
25
26
template <typename... IdentifierInfos>
27
static inline void lazyInitKeywordSelector(Selector &Sel, ASTContext &Ctx,
28
3
                                           IdentifierInfos *... IIs) {
29
3
  if (!Sel.isNull())
30
1
    return;
31
2
  Sel = getKeywordSelector(Ctx, IIs...);
32
2
}
NoReturnFunctionChecker.cpp:void clang::lazyInitKeywordSelector<char const, char const, char const, char const>(clang::Selector&, clang::ASTContext&, char const*, char const*, char const*, char const*)
Line
Count
Source
28
1
                                           IdentifierInfos *... IIs) {
29
1
  if (!Sel.isNull())
30
0
    return;
31
1
  Sel = getKeywordSelector(Ctx, IIs...);
32
1
}
NoReturnFunctionChecker.cpp:void clang::lazyInitKeywordSelector<char const, char const, char const, char const, char const>(clang::Selector&, clang::ASTContext&, char const*, char const*, char const*, char const*, char const*)
Line
Count
Source
28
2
                                           IdentifierInfos *... IIs) {
29
2
  if (!Sel.isNull())
30
1
    return;
31
1
  Sel = getKeywordSelector(Ctx, IIs...);
32
1
}
33
34
} // end namespace clang
35
36
#endif