Home
last modified time | relevance | path

Searched refs:Tok (Results 1 – 25 of 108) sorted by relevance

12345

/external/clang/lib/Parse/
DParsePragma.cpp315 assert(Tok.is(tok::annot_pragma_unused)); in HandlePragmaUnused()
317 Actions.ActOnPragmaUnused(Tok, getCurScope(), UnusedLoc); in HandlePragmaUnused()
322 assert(Tok.is(tok::annot_pragma_vis)); in HandlePragmaVisibility()
324 static_cast<IdentifierInfo *>(Tok.getAnnotationValue()); in HandlePragmaVisibility()
338 assert(Tok.is(tok::annot_pragma_pack)); in HandlePragmaPack()
340 static_cast<PragmaPackInfo *>(Tok.getAnnotationValue()); in HandlePragmaPack()
353 assert(Tok.is(tok::annot_pragma_msstruct)); in HandlePragmaMSStruct()
356 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue())); in HandlePragmaMSStruct()
362 assert(Tok.is(tok::annot_pragma_align)); in HandlePragmaAlign()
365 reinterpret_cast<uintptr_t>(Tok.getAnnotationValue())); in HandlePragmaAlign()
[all …]
DParseObjc.cpp28 if (Tok.is(tok::kw___attribute)) { in MaybeSkipAttributes()
30 Diag(Tok, diag::err_objc_postfix_attribute_hint) in MaybeSkipAttributes()
33 Diag(Tok, diag::err_objc_postfix_attribute); in MaybeSkipAttributes()
49 if (Tok.is(tok::code_completion)) { in ParseObjCAtDirectives()
56 switch (Tok.getObjCKeywordID()) { in ParseObjCAtDirectives()
109 if (Tok.isNot(tok::identifier)) { in ParseObjCAtClassDeclaration()
110 Diag(Tok, diag::err_expected) << tok::identifier; in ParseObjCAtClassDeclaration()
114 ClassNames.push_back(Tok.getIdentifierInfo()); in ParseObjCAtClassDeclaration()
115 ClassLocs.push_back(Tok.getLocation()); in ParseObjCAtClassDeclaration()
181 assert(Tok.isObjCAtKeyword(tok::objc_interface) && in ParseObjCAtInterfaceDeclaration()
[all …]
DParseCXXInlineMethods.cpp32 assert((Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try) || in ParseCXXInlineMethodDef()
33 Tok.is(tok::equal)) && in ParseCXXInlineMethodDef()
72 SourceLocation KWEndLoc = Tok.getEndLoc().getLocWithOffset(-1); in ParseCXXInlineMethodDef()
94 if (Tok.is(tok::comma)) { in ParseCXXInlineMethodDef()
138 tok::TokenKind kind = Tok.getKind(); in ParseCXXInlineMethodDef()
158 while (Tok.is(tok::kw_catch)) { in ParseCXXInlineMethodDef()
194 assert((Tok.is(tok::l_brace) || Tok.is(tok::equal)) && in ParseCXXNonStaticMemberInitializer()
202 tok::TokenKind kind = Tok.getKind(); in ParseCXXNonStaticMemberInitializer()
204 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer()
210 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer()
[all …]
DParser.cpp57 Tok.startToken(); in Parser()
58 Tok.setKind(tok::eof); in Parser()
78 DiagnosticBuilder Parser::Diag(const Token &Tok, unsigned DiagID) { in Diag() argument
79 return Diag(Tok.getLocation(), DiagID); in Diag()
103 static bool IsCommonTypo(tok::TokenKind ExpectedTok, const Token &Tok) { in IsCommonTypo() argument
106 return Tok.is(tok::colon) || Tok.is(tok::comma); // : or , for ; in IsCommonTypo()
113 if (Tok.is(ExpectedTok) || Tok.is(tok::code_completion)) { in ExpectAndConsume()
119 if (IsCommonTypo(ExpectedTok, Tok)) { in ExpectAndConsume()
120 SourceLocation Loc = Tok.getLocation(); in ExpectAndConsume()
146 : Diag(Tok, DiagID); in ExpectAndConsume()
[all …]
DParseTemplate.cpp33 if (Tok.is(tok::kw_template) && NextToken().isNot(tok::less)) { in ParseDeclarationStartingWithTemplate()
64 assert((Tok.is(tok::kw_export) || Tok.is(tok::kw_template)) && in ParseTemplateDeclarationOrSpecialization()
109 Diag(Tok.getLocation(), diag::err_expected_template); in ParseTemplateDeclarationOrSpecialization()
137 } while (Tok.is(tok::kw_export) || Tok.is(tok::kw_template)); in ParseTemplateDeclarationOrSpecialization()
169 if (Tok.is(tok::kw_static_assert)) { in ParseSingleDeclarationAfterTemplate()
171 Diag(Tok.getLocation(), diag::err_templated_invalid_declaration) in ParseSingleDeclarationAfterTemplate()
187 if (Tok.is(tok::kw_using)) in ParseSingleDeclarationAfterTemplate()
198 if (Tok.is(tok::semi)) { in ParseSingleDeclarationAfterTemplate()
223 if (Tok.is(tok::semi)) in ParseSingleDeclarationAfterTemplate()
239 Diag(Tok, diag::err_function_definition_not_allowed); in ParseSingleDeclarationAfterTemplate()
[all …]
DParseDeclCXX.cpp60 assert(Tok.is(tok::kw_namespace) && "Not a namespace!"); in ParseNamespace()
64 if (Tok.is(tok::code_completion)) { in ParseNamespace()
80 Diag(Tok.getLocation(), diag::warn_cxx14_compat_attribute) in ParseNamespace()
82 attrLoc = Tok.getLocation(); in ParseNamespace()
86 if (Tok.is(tok::identifier)) { in ParseNamespace()
87 Ident = Tok.getIdentifierInfo(); in ParseNamespace()
89 while (Tok.is(tok::coloncolon) && NextToken().is(tok::identifier)) { in ParseNamespace()
91 ExtraIdent.push_back(Tok.getIdentifierInfo()); in ParseNamespace()
101 if (Tok.is(tok::kw___attribute)) { in ParseNamespace()
102 attrLoc = Tok.getLocation(); in ParseNamespace()
[all …]
DParseTentative.cpp51 switch (Tok.getKind()) { in isCXXDeclarationStatement()
148 switch (Tok.getKind()) { in TryConsumeDeclarationSpecifier()
159 if (Tok.isNot(tok::l_paren)) in TryConsumeDeclarationSpecifier()
182 while (Tok.is(tok::l_square) || Tok.is(tok::kw___attribute) || in TryConsumeDeclarationSpecifier()
183 Tok.is(tok::kw___declspec) || Tok.is(tok::kw_alignas)) { in TryConsumeDeclarationSpecifier()
184 if (Tok.is(tok::l_square)) { in TryConsumeDeclarationSpecifier()
190 if (Tok.isNot(tok::l_paren)) in TryConsumeDeclarationSpecifier()
198 if ((Tok.is(tok::identifier) || Tok.is(tok::coloncolon) || in TryConsumeDeclarationSpecifier()
199 Tok.is(tok::kw_decltype) || Tok.is(tok::annot_template_id)) && in TryConsumeDeclarationSpecifier()
202 if (Tok.is(tok::annot_cxxscope)) in TryConsumeDeclarationSpecifier()
[all …]
DParseOpenMP.cpp38 auto Tok = P.getCurToken(); in ParseOpenMPDirectiveKind() local
40 Tok.isAnnotation() in ParseOpenMPDirectiveKind()
42 : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok)); in ParseOpenMPDirectiveKind()
45 Tok = P.getPreprocessor().LookAhead(0); in ParseOpenMPDirectiveKind()
47 Tok.isAnnotation() in ParseOpenMPDirectiveKind()
49 : getOpenMPDirectiveKind(P.getPreprocessor().getSpelling(Tok)); in ParseOpenMPDirectiveKind()
65 assert(Tok.is(tok::annot_pragma_openmp) && "Not an OpenMP directive!"); in ParseOpenMPDeclarativeDirective()
78 if (Tok.isNot(tok::annot_pragma_openmp_end)) { in ParseOpenMPDeclarativeDirective()
79 Diag(Tok, diag::warn_omp_extra_tokens_at_eol) in ParseOpenMPDeclarativeDirective()
89 Diag(Tok, diag::err_omp_unknown_directive); in ParseOpenMPDeclarativeDirective()
[all …]
DParseInit.cpp28 switch (Tok.getKind()) { in MayBeDesignationStart()
87 tok::TokenKind Kind = Tok.getKind(); in MayBeDesignationStart()
137 if (Tok.is(tok::identifier)) { in ParseInitializerWithPotentialDesignator()
138 const IdentifierInfo *FieldName = Tok.getIdentifierInfo(); in ParseInitializerWithPotentialDesignator()
146 assert(Tok.is(tok::colon) && "MayBeDesignationStart not working properly!"); in ParseInitializerWithPotentialDesignator()
165 while (Tok.is(tok::period) || Tok.is(tok::l_square)) { in ParseInitializerWithPotentialDesignator()
166 if (Tok.is(tok::period)) { in ParseInitializerWithPotentialDesignator()
170 if (Tok.isNot(tok::identifier)) { in ParseInitializerWithPotentialDesignator()
171 Diag(Tok.getLocation(), diag::err_expected_field_designator); in ParseInitializerWithPotentialDesignator()
175 Desig.AddDesignator(Designator::getField(Tok.getIdentifierInfo(), DotLoc, in ParseInitializerWithPotentialDesignator()
[all …]
DParseStmt.cpp161 tok::TokenKind Kind = Tok.getKind(); in ParseStatementOrDeclarationAfterAttributes()
194 if (Tok.is(tok::semi)) in ParseStatementOrDeclarationAfterAttributes()
200 if (Tok.isNot(tok::identifier)) in ParseStatementOrDeclarationAfterAttributes()
209 SourceLocation DeclStart = Tok.getLocation(), DeclEnd; in ParseStatementOrDeclarationAfterAttributes()
215 if (Tok.is(tok::r_brace)) { in ParseStatementOrDeclarationAfterAttributes()
216 Diag(Tok, diag::err_expected_statement); in ParseStatementOrDeclarationAfterAttributes()
231 bool HasLeadingEmptyMacro = Tok.hasLeadingEmptyMacro(); in ParseStatementOrDeclarationAfterAttributes()
333 Diag(Tok, diag::err_pragma_fp_contract_scope); in ParseStatementOrDeclarationAfterAttributes()
381 Token OldToken = Tok; in ParseExprStatement()
390 if (Tok.is(tok::semi)) in ParseExprStatement()
[all …]
DParseExpr.cpp158 if (Tok.is(tok::code_completion)) { in ParseAssignmentExpression()
164 if (Tok.is(tok::kw_throw)) in ParseAssignmentExpression()
209 tok::TokenKind K = Tok.getKind(); in isNotExpressionStart()
230 prec::Level NextTokPrec = getBinOpPrecedence(Tok.getKind(), in ParseRHSOfBinaryExpression()
243 Token OpToken = Tok; in ParseRHSOfBinaryExpression()
252 PP.EnterToken(Tok); in ParseRHSOfBinaryExpression()
253 Tok = OpToken; in ParseRHSOfBinaryExpression()
259 if (isFoldOperator(NextTokPrec) && Tok.is(tok::ellipsis)) { in ParseRHSOfBinaryExpression()
262 PP.EnterToken(Tok); in ParseRHSOfBinaryExpression()
263 Tok = OpToken; in ParseRHSOfBinaryExpression()
[all …]
DParseExprCXX.cpp92 TemplateName.setIdentifier(&II, Tok.getLocation()); in CheckForTemplateAndDigraph()
108 if (!Tok.is(tok::l_paren)) in CheckForLParenAfterColonColon()
111 Token LParen = Tok; in CheckForLParenAfterColonColon()
196 if (Tok.is(tok::annot_cxxscope)) { in ParseOptionalCXXScopeSpecifier()
199 Actions.RestoreNestedNameSpecifierAnnotation(Tok.getAnnotationValue(), in ParseOptionalCXXScopeSpecifier()
200 Tok.getAnnotationRange(), in ParseOptionalCXXScopeSpecifier()
206 if (Tok.is(tok::annot_template_id)) { in ParseOptionalCXXScopeSpecifier()
209 TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok); in ParseOptionalCXXScopeSpecifier()
225 if (Tok.is(tok::coloncolon)) { in ParseOptionalCXXScopeSpecifier()
246 if (Tok.is(tok::kw___super)) { in ParseOptionalCXXScopeSpecifier()
[all …]
DParseDecl.cpp126 assert(Tok.is(tok::kw___attribute) && "Not a GNU attribute list!"); in ParseGNUAttributes()
128 while (Tok.is(tok::kw___attribute)) { in ParseGNUAttributes()
146 if (Tok.isAnnotation()) in ParseGNUAttributes()
148 IdentifierInfo *AttrName = Tok.getIdentifierInfo(); in ParseGNUAttributes()
154 if (Tok.isNot(tok::l_paren)) { in ParseGNUAttributes()
182 Eof.setLocation(Tok.getLocation()); in ParseGNUAttributes()
188 SourceLocation Loc = Tok.getLocation(); in ParseGNUAttributes()
232 assert(Tok.is(tok::identifier) && "expected an identifier"); in ParseIdentifierLoc()
234 Tok.getLocation(), in ParseIdentifierLoc()
235 Tok.getIdentifierInfo()); in ParseIdentifierLoc()
[all …]
DParseStmtAsm.cpp164 const Token &Tok = AsmToks[TokIndex]; in translateLocation() local
165 Loc = Tok.getLocation(); in translateLocation()
200 LineToks.push_back(Tok); in ParseMSAsmIdentifier()
227 if (Tok.is(EndOfStream)) { in ParseMSAsmIdentifier()
230 while (LineToks[LineIndex].getLocation() != Tok.getLocation()) { in ParseMSAsmIdentifier()
238 if (Invalid || Tok.is(EndOfStream)) { in ParseMSAsmIdentifier()
250 assert(Tok.is(EndOfStream)); in ParseMSAsmIdentifier()
274 const Token &Tok = AsmToks[i]; in buildMSAsmString() local
277 if (!isNewStatement && (Tok.is(tok::kw_asm) || Tok.isAtStartOfLine())) { in buildMSAsmString()
284 if (!isNewStatement && Tok.hasLeadingSpace()) in buildMSAsmString()
[all …]
/external/clang/lib/Lex/
DPragma.cpp79 Token &Tok) { in HandlePragma() argument
82 PP.LexUnexpandedToken(Tok); in HandlePragma()
86 = FindHandler(Tok.getIdentifierInfo() ? Tok.getIdentifierInfo()->getName() in HandlePragma()
90 PP.Diag(Tok, diag::warn_pragma_ignored); in HandlePragma()
95 Handler->HandlePragma(PP, Introducer, Tok); in HandlePragma()
115 Token Tok; in HandlePragmaDirective() local
116 PragmaHandlers->HandlePragma(*this, Introducer, Tok); in HandlePragmaDirective()
135 Token &Tok) in LexingFor_PragmaRAII() argument
137 Failed(false), OutTok(Tok) { in LexingFor_PragmaRAII()
164 void Preprocessor::Handle_Pragma(Token &Tok) { in Handle_Pragma() argument
[all …]
DPPMacroExpansion.cpp293 Callbacks->MacroExpands(Info.Tok, Info.MD, Info.Range, in HandleMacroExpandedIdentifier()
527 Token Tok; in ReadFunctionLikeMacroArgs() local
531 LexUnexpandedToken(Tok); in ReadFunctionLikeMacroArgs()
532 assert(Tok.is(tok::l_paren) && "Error computing l-paren-ness?"); in ReadFunctionLikeMacroArgs()
543 while (Tok.isNot(tok::r_paren)) { in ReadFunctionLikeMacroArgs()
544 if (ContainsCodeCompletionTok && (Tok.is(tok::eof) || Tok.is(tok::eod))) in ReadFunctionLikeMacroArgs()
547 assert((Tok.is(tok::l_paren) || Tok.is(tok::comma)) && in ReadFunctionLikeMacroArgs()
551 SourceLocation ArgStartLoc = Tok.getLocation(); in ReadFunctionLikeMacroArgs()
560 LexUnexpandedToken(Tok); in ReadFunctionLikeMacroArgs()
562 if (Tok.is(tok::eof) || Tok.is(tok::eod)) { // "#if f(<eof>" & "#if f(\n" in ReadFunctionLikeMacroArgs()
[all …]
DTokenConcatenation.cpp48 bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const { in IsIdentifierStringPrefix()
51 if (!Tok.needsCleaning()) { in IsIdentifierStringPrefix()
52 if (Tok.getLength() < 1 || Tok.getLength() > 3) in IsIdentifierStringPrefix()
55 const char *Ptr = SM.getCharacterData(SM.getSpellingLoc(Tok.getLocation())); in IsIdentifierStringPrefix()
56 return IsStringPrefix(StringRef(Ptr, Tok.getLength()), in IsIdentifierStringPrefix()
60 if (Tok.getLength() < 256) { in IsIdentifierStringPrefix()
63 unsigned length = PP.getSpelling(Tok, TokPtr); in IsIdentifierStringPrefix()
67 return IsStringPrefix(StringRef(PP.getSpelling(Tok)), LangOpts.CPlusPlus11); in IsIdentifierStringPrefix()
125 static char GetFirstChar(Preprocessor &PP, const Token &Tok) { in GetFirstChar() argument
126 if (IdentifierInfo *II = Tok.getIdentifierInfo()) { in GetFirstChar()
[all …]
DTokenLexer.cpp26 void TokenLexer::Init(Token &Tok, SourceLocation ELEnd, MacroInfo *MI, in Init() argument
36 ExpandLocStart = Tok.getLocation(); in Init()
38 AtStartOfLine = Tok.isAtStartOfLine(); in Init()
39 HasLeadingSpace = Tok.hasLeadingSpace(); in Init()
292 Token &Tok = ResultToks[i]; in ExpandFunctionArguments() local
293 if (Tok.is(tok::hashhash)) in ExpandFunctionArguments()
294 Tok.setKind(tok::unknown); in ExpandFunctionArguments()
336 Token &Tok = ResultToks[i]; in ExpandFunctionArguments() local
337 if (Tok.is(tok::hashhash)) in ExpandFunctionArguments()
338 Tok.setKind(tok::unknown); in ExpandFunctionArguments()
[all …]
DModuleMap.cpp1033 MMToken Tok; member in clang::ModuleMapParser
1077 Tok.clear(); in ModuleMapParser()
1087 SourceLocation Result = Tok.getLocation(); in consumeToken()
1088 Tok.clear(); in consumeToken()
1092 Tok.Location = LToken.getLocation().getRawEncoding(); in consumeToken()
1096 Tok.StringData = RI.data(); in consumeToken()
1097 Tok.StringLength = RI.size(); in consumeToken()
1098 Tok.Kind = llvm::StringSwitch<MMToken::TokenKind>(RI) in consumeToken()
1119 Tok.Kind = MMToken::Comma; in consumeToken()
1123 Tok.Kind = MMToken::EndOfFile; in consumeToken()
[all …]
DMacroArgs.cpp174 Token &Tok = Result.back(); in getPreExpArgument() local
175 PP.Lex(Tok); in getPreExpArgument()
199 Token Tok; in StringifyArgument() local
200 Tok.startToken(); in StringifyArgument()
201 Tok.setKind(Charify ? tok::char_constant : tok::string_literal); in StringifyArgument()
211 const Token &Tok = *ArgToks; in StringifyArgument() local
212 if (!isFirst && (Tok.hasLeadingSpace() || Tok.isAtStartOfLine())) in StringifyArgument()
218 if (tok::isStringLiteral(Tok.getKind()) || // "foo", u8R"x(foo)x"_bar, etc. in StringifyArgument()
219 Tok.is(tok::char_constant) || // 'x' in StringifyArgument()
220 Tok.is(tok::wide_char_constant) || // L'x'. in StringifyArgument()
[all …]
/external/clang/lib/AST/
DCommentParser.cpp60 const Token &Tok = Toks[Pos.CurToken]; in setupBuffer() local
62 Pos.BufferStart = Tok.getText().begin(); in setupBuffer()
63 Pos.BufferEnd = Tok.getText().end(); in setupBuffer()
65 Pos.BufferStartLoc = Tok.getLocation(); in setupBuffer()
100 if (P.Tok.is(tok::newline)) { in addToken()
102 Token Newline = P.Tok; in addToken()
104 if (P.Tok.isNot(tok::text)) { in addToken()
110 if (P.Tok.isNot(tok::text)) { in addToken()
115 Toks.push_back(P.Tok); in addToken()
154 bool lexWord(Token &Tok) { in lexWord() argument
[all …]
/external/clang/lib/Rewrite/
DHTMLRewrite.cpp371 Token Tok; in SyntaxHighlight() local
372 L.LexFromRawLexer(Tok); in SyntaxHighlight()
374 while (Tok.isNot(tok::eof)) { in SyntaxHighlight()
377 unsigned TokOffs = SM.getFileOffset(Tok.getLocation()); in SyntaxHighlight()
378 unsigned TokLen = Tok.getLength(); in SyntaxHighlight()
379 switch (Tok.getKind()) { in SyntaxHighlight()
386 PP.LookUpIdentifierInfo(Tok); in SyntaxHighlight()
389 if (Tok.isNot(tok::identifier)) in SyntaxHighlight()
417 if (!Tok.isAtStartOfLine()) in SyntaxHighlight()
423 L.LexFromRawLexer(Tok); in SyntaxHighlight()
[all …]
/external/clang/lib/Format/
DUnwrappedLineParser.cpp103 FormatTok.Tok.startToken(); in getFakeEOF()
104 FormatTok.Tok.setKind(tok::eof); in getFakeEOF()
277 switch (FormatTok->Tok.getKind()) { in parseLevel()
316 FormatToken *Tok = FormatTok; in calculateBraceTypes() local
321 assert(Tok->Tok.is(tok::l_brace)); in calculateBraceTypes()
331 switch (Tok->Tok.getKind()) { in calculateBraceTypes()
333 LBraceStack.push_back(Tok); in calculateBraceTypes()
362 Tok->BlockKind = BK_BracedInit; in calculateBraceTypes()
365 Tok->BlockKind = BK_Block; in calculateBraceTypes()
386 Tok = NextTok; in calculateBraceTypes()
[all …]
/external/clang/lib/Frontend/
DPrintPreprocessedOutput.cpp145 bool HandleFirstTokOnLine(Token &Tok);
159 const Token &Tok) { in AvoidConcat() argument
160 return ConcatInfo.AvoidConcat(PrevPrevTok, PrevTok, Tok); in AvoidConcat()
505 bool PrintPPOutputPPCallbacks::HandleFirstTokOnLine(Token &Tok) { in HandleFirstTokOnLine() argument
508 if (!MoveToLine(Tok.getLocation())) in HandleFirstTokOnLine()
513 unsigned ColNo = SM.getExpansionColumnNumber(Tok.getLocation()); in HandleFirstTokOnLine()
519 if (ColNo == 1 && Tok.hasLeadingSpace()) in HandleFirstTokOnLine()
528 if (ColNo <= 1 && Tok.is(tok::hash)) in HandleFirstTokOnLine()
595 static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, in PrintPreprocessedTokens() argument
608 Callbacks->MoveToLine(Tok.getLocation()); in PrintPreprocessedTokens()
[all …]
/external/clang/include/clang/Lex/
DPreprocessor.h76 bool operator==(const Token &Tok) const {
77 return Tok.getKind() == Kind &&
78 (!II || II == Tok.getIdentifierInfo());
358 Token Tok; member
361 MacroExpandsInfo(Token Tok, MacroDirective *MD, SourceRange Range) in MacroExpandsInfo()
362 : Tok(Tok), MD(MD), Range(Range) { } in MacroExpandsInfo()
862 bool parseSimpleIntegerLiteral(Token &Tok, uint64_t &Value);
903 void EnterToken(const Token &Tok) { in EnterToken() argument
905 CachedTokens.insert(CachedTokens.begin()+CachedLexPos, Tok); in EnterToken()
916 void AnnotateCachedTokens(const Token &Tok) { in AnnotateCachedTokens() argument
[all …]

12345