File indexing completed on 2026-05-10 08:36:27
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_CLANG_ANALYSIS_SELECTOREXTRAS_H
0010 #define LLVM_CLANG_ANALYSIS_SELECTOREXTRAS_H
0011
0012 #include "clang/AST/ASTContext.h"
0013
0014 namespace clang {
0015
0016 template <typename... IdentifierInfos>
0017 static inline Selector getKeywordSelector(ASTContext &Ctx,
0018 const IdentifierInfos *...IIs) {
0019 static_assert(sizeof...(IdentifierInfos) > 0,
0020 "keyword selectors must have at least one argument");
0021 SmallVector<const IdentifierInfo *, 10> II({&Ctx.Idents.get(IIs)...});
0022
0023 return Ctx.Selectors.getSelector(II.size(), &II[0]);
0024 }
0025
0026 template <typename... IdentifierInfos>
0027 static inline void lazyInitKeywordSelector(Selector &Sel, ASTContext &Ctx,
0028 IdentifierInfos *... IIs) {
0029 if (!Sel.isNull())
0030 return;
0031 Sel = getKeywordSelector(Ctx, IIs...);
0032 }
0033
0034 }
0035
0036 #endif