Coverage Report

Created: 2020-09-22 08:39

/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_LIB_ANALYSIS_SELECTOREXTRAS_H
10
#define LLVM_CLANG_LIB_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
628
                                          IdentifierInfos *... IIs) {
19
628
  static_assert(sizeof...(IdentifierInfos),
20
628
                "keyword selectors must have at least one argument");
21
628
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
628
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
628
}
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),
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),
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),
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),
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),
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),
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
54
                                          IdentifierInfos *... IIs) {
19
54
  static_assert(sizeof...(IdentifierInfos),
20
54
                "keyword selectors must have at least one argument");
21
54
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
54
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
54
}
TrustNonnullChecker.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
54
                                          IdentifierInfos *... IIs) {
19
54
  static_assert(sizeof...(IdentifierInfos),
20
54
                "keyword selectors must have at least one argument");
21
54
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
54
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
54
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const>(clang::ASTContext&, char const*)
Line
Count
Source
18
176
                                          IdentifierInfos *... IIs) {
19
176
  static_assert(sizeof...(IdentifierInfos),
20
176
                "keyword selectors must have at least one argument");
21
176
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
176
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
176
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
176
                                          IdentifierInfos *... IIs) {
19
176
  static_assert(sizeof...(IdentifierInfos),
20
176
                "keyword selectors must have at least one argument");
21
176
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
176
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
176
}
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
88
                                          IdentifierInfos *... IIs) {
19
88
  static_assert(sizeof...(IdentifierInfos),
20
88
                "keyword selectors must have at least one argument");
21
88
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
23
88
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
88
}
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