Coverage Report

Created: 2020-02-15 09:57

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