Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/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
485
                                          IdentifierInfos *... IIs) {
19
485
  static_assert(sizeof...(IdentifierInfos),
20
485
                "keyword selectors must have at least one argument");
21
485
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
485
23
485
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
485
}
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
45
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
25
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
4
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
4
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
1
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
1
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
20
                                          IdentifierInfos *... IIs) {
19
20
  static_assert(sizeof...(IdentifierInfos),
20
20
                "keyword selectors must have at least one argument");
21
20
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
20
23
20
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
20
}
TrustNonnullChecker.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
20
                                          IdentifierInfos *... IIs) {
19
20
  static_assert(sizeof...(IdentifierInfos),
20
20
                "keyword selectors must have at least one argument");
21
20
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
20
23
20
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
20
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const>(clang::ASTContext&, char const*)
Line
Count
Source
18
146
                                          IdentifierInfos *... IIs) {
19
146
  static_assert(sizeof...(IdentifierInfos),
20
146
                "keyword selectors must have at least one argument");
21
146
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
146
23
146
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
146
}
RetainSummaryManager.cpp:clang::Selector clang::getKeywordSelector<char const, char const>(clang::ASTContext&, char const*, char const*)
Line
Count
Source
18
146
                                          IdentifierInfos *... IIs) {
19
146
  static_assert(sizeof...(IdentifierInfos),
20
146
                "keyword selectors must have at least one argument");
21
146
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
146
23
146
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
146
}
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
73
                                          IdentifierInfos *... IIs) {
19
73
  static_assert(sizeof...(IdentifierInfos),
20
73
                "keyword selectors must have at least one argument");
21
73
  SmallVector<IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
22
73
23
73
  return Ctx.Selectors.getSelector(II.size(), &II[0]);
24
73
}
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