clang
8.0.0
include
clang
Analysis
SelectorExtras.h
Go to the documentation of this file.
1
//=== SelectorExtras.h - Helpers for checkers using selectors -----*- C++ -*-=//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_CLANG_LIB_ANALYSIS_SELECTOREXTRAS_H
11
#define LLVM_CLANG_LIB_ANALYSIS_SELECTOREXTRAS_H
12
13
#include "
clang/AST/ASTContext.h
"
14
15
namespace
clang
{
16
17
template
<
typename
... IdentifierInfos>
18
static
inline
Selector
getKeywordSelector
(
ASTContext
&Ctx,
19
IdentifierInfos *... IIs) {
20
static_assert(
sizeof
...(IdentifierInfos),
21
"keyword selectors must have at least one argument"
);
22
SmallVector<IdentifierInfo *, 10>
II({&Ctx.
Idents
.
get
(IIs)...});
23
24
return
Ctx.
Selectors
.
getSelector
(II.size(), &II[0]);
25
}
26
27
template
<
typename
... IdentifierInfos>
28
static
inline
void
lazyInitKeywordSelector
(
Selector
&Sel,
ASTContext
&Ctx,
29
IdentifierInfos *... IIs) {
30
if
(!Sel.
isNull
())
31
return
;
32
Sel =
getKeywordSelector
(Ctx, IIs...);
33
}
34
35
}
// end namespace clang
36
37
#endif
ASTContext.h
Defines the clang::ASTContext interface.
clang::Selector
Smart pointer class that efficiently represents Objective-C method names.
Definition:
IdentifierTable.h:673
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition:
ASTContext.h:155
clang::ASTContext::Idents
IdentifierTable & Idents
Definition:
ASTContext.h:566
clang::ASTContext::Selectors
SelectorTable & Selectors
Definition:
ASTContext.h:567
clang::IdentifierTable::get
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
Definition:
IdentifierTable.h:519
clang::lazyInitKeywordSelector
static void lazyInitKeywordSelector(Selector &Sel, ASTContext &Ctx, IdentifierInfos *... IIs)
Definition:
SelectorExtras.h:28
clang::getKeywordSelector
static Selector getKeywordSelector(ASTContext &Ctx, IdentifierInfos *... IIs)
Definition:
SelectorExtras.h:18
llvm::SmallVector
Definition:
LLVM.h:36
clang
Dataflow Directional Tag Classes.
Definition:
CFGReachabilityAnalysis.h:22
clang::SelectorTable::getSelector
Selector getSelector(unsigned NumArgs, IdentifierInfo **IIV)
Can create any sort of selector.
Definition:
IdentifierTable.cpp:635
clang::Selector::isNull
bool isNull() const
Determine whether this is the empty selector.
Definition:
IdentifierTable.h:743
Generated on Tue Mar 12 2019 12:25:54 for clang by
1.8.13