Home
last modified time | relevance | path

Searched refs:Toks (Results 1 – 25 of 64) sorted by relevance

123

/external/llvm-project/clang/unittests/AST/
DCommentLexer.cpp45 void lexString(const char *Source, std::vector<Token> &Toks);
61 std::vector<Token> &Toks) { in lexString() argument
73 Toks.push_back(Tok); in lexString()
82 std::vector<Token> Toks; in TEST_F() local
84 lexString(Source, Toks); in TEST_F()
86 ASSERT_EQ(0U, Toks.size()); in TEST_F()
95 std::vector<Token> Toks; in TEST_F() local
97 lexString(Sources[i], Toks); in TEST_F()
99 ASSERT_EQ(1U, Toks.size()); in TEST_F()
101 ASSERT_EQ(tok::newline, Toks[0].getKind()); in TEST_F()
[all …]
/external/clang/unittests/AST/
DCommentLexer.cpp46 void lexString(const char *Source, std::vector<Token> &Toks);
62 std::vector<Token> &Toks) { in lexString() argument
74 Toks.push_back(Tok); in lexString()
83 std::vector<Token> Toks; in TEST_F() local
85 lexString(Source, Toks); in TEST_F()
87 ASSERT_EQ(0U, Toks.size()); in TEST_F()
96 std::vector<Token> Toks; in TEST_F() local
98 lexString(Sources[i], Toks); in TEST_F()
100 ASSERT_EQ(1U, Toks.size()); in TEST_F()
102 ASSERT_EQ(tok::newline, Toks[0].getKind()); in TEST_F()
[all …]
/external/clang/lib/Parse/
DParseCXXInlineMethods.cpp123 CachedTokens Toks; in ParseCXXInlineMethodDef() local
124 LexTemplateFunctionForLateParsing(Toks); in ParseCXXInlineMethodDef()
129 Actions.MarkAsLateParsedTemplate(FD, FnD, Toks); in ParseCXXInlineMethodDef()
140 CachedTokens &Toks = LM->Toks; in ParseCXXInlineMethodDef() local
145 if (ConsumeAndStoreFunctionPrologue(Toks)) { in ParseCXXInlineMethodDef()
157 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
163 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
164 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
204 CachedTokens &Toks = MI->Toks; in ParseCXXNonStaticMemberInitializer() local
208 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer()
[all …]
DParsePragma.cpp734 Token Toks[1]; in HandlePragmaMSInitSeg() local
735 Toks[0].startToken(); in HandlePragmaMSInitSeg()
736 Toks[0].setKind(tok::string_literal); in HandlePragmaMSInitSeg()
737 Toks[0].setLocation(Tok.getLocation()); in HandlePragmaMSInitSeg()
738 Toks[0].setLiteralData(Section.data()); in HandlePragmaMSInitSeg()
739 Toks[0].setLength(Section.size()); in HandlePragmaMSInitSeg()
741 cast<StringLiteral>(Actions.ActOnStringLiteral(Toks, nullptr).get()); in HandlePragmaMSInitSeg()
776 ArrayRef<Token> Toks; member
810 llvm::ArrayRef<Token> Toks = Info->Toks; in HandlePragmaLoopHint() local
816 if (Toks.empty() && (PragmaUnroll || PragmaNoUnroll)) { in HandlePragmaLoopHint()
[all …]
DParseTemplate.cpp1369 assert(!LPT.Toks.empty() && "Empty body!"); in ParseLateTemplatedFuncDef()
1373 LPT.Toks.push_back(Tok); in ParseLateTemplatedFuncDef()
1374 PP.EnterTokenStream(LPT.Toks, true); in ParseLateTemplatedFuncDef()
1421 void Parser::LexTemplateFunctionForLateParsing(CachedTokens &Toks) { in LexTemplateFunctionForLateParsing() argument
1423 if (!ConsumeAndStoreFunctionPrologue(Toks)) { in LexTemplateFunctionForLateParsing()
1425 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in LexTemplateFunctionForLateParsing()
1431 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false); in LexTemplateFunctionForLateParsing()
1432 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in LexTemplateFunctionForLateParsing()
/external/llvm-project/clang/lib/Parse/
DParseCXXInlineMethods.cpp120 CachedTokens Toks; in ParseCXXInlineMethodDef() local
121 LexTemplateFunctionForLateParsing(Toks); in ParseCXXInlineMethodDef()
126 Actions.MarkAsLateParsedTemplate(FD, FnD, Toks); in ParseCXXInlineMethodDef()
136 CachedTokens &Toks = LM->Toks; in ParseCXXInlineMethodDef() local
141 if (ConsumeAndStoreFunctionPrologue(Toks)) { in ParseCXXInlineMethodDef()
153 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
159 ConsumeAndStoreUntil(tok::l_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
160 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in ParseCXXInlineMethodDef()
191 CachedTokens &Toks = MI->Toks; in ParseCXXNonStaticMemberInitializer() local
195 Toks.push_back(Tok); in ParseCXXNonStaticMemberInitializer()
[all …]
DParsePragma.cpp116 MutableArrayRef<Token> Toks(PP.getPreprocessorAllocator().Allocate<Token>(1), in HandlePragma() local
118 Toks[0].startToken(); in HandlePragma()
119 Toks[0].setKind(tok::annot_pragma_fenv_access); in HandlePragma()
120 Toks[0].setLocation(Tok.getLocation()); in HandlePragma()
121 Toks[0].setAnnotationEndLoc(Tok.getLocation()); in HandlePragma()
122 Toks[0].setAnnotationValue(reinterpret_cast<void*>( in HandlePragma()
124 PP.EnterTokenStream(Toks, /*DisableMacroExpansion=*/true, in HandlePragma()
1038 Token Toks[1]; in HandlePragmaMSInitSeg() local
1039 Toks[0].startToken(); in HandlePragmaMSInitSeg()
1040 Toks[0].setKind(tok::string_literal); in HandlePragmaMSInitSeg()
[all …]
DParseObjc.cpp2651 CachedTokens &Toks = LM->Toks; in StashAwayMethodOrFunctionBodyTokens() local
2653 Toks.push_back(Tok); in StashAwayMethodOrFunctionBodyTokens()
2657 Toks.push_back(Tok); in StashAwayMethodOrFunctionBodyTokens()
2660 ConsumeAndStoreUntil(tok::l_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2661 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2664 Toks.push_back(Tok); // also store '{' in StashAwayMethodOrFunctionBodyTokens()
2670 ConsumeAndStoreUntil(tok::l_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2671 ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
2673 Toks.push_back(Tok); // also store '{' in StashAwayMethodOrFunctionBodyTokens()
2677 ConsumeAndStoreUntil(tok::r_brace, Toks, /*StopAtSemi=*/false); in StashAwayMethodOrFunctionBodyTokens()
[all …]
/external/llvm-project/clang-tools-extra/clangd/refactor/tweaks/
DObjCLocalizeStringLiteral.cpp71 auto Toks = TB.spelledForExpanded(TB.expandedTokens(Str->getSourceRange())); in apply() local
72 if (!Toks || Toks->empty()) in apply()
76 SM, Toks->front().location(), 0, "NSLocalizedString(")); in apply()
79 tooling::Replacement(SM, Toks->back().endLocation(), 0, ", @\"\")"))) in apply()
DDefineOutline.cpp320 auto Toks = TokBuf.expandedTokens(CD->getSourceRange()); in getDeletionRange() local
322 Toks = Toks.take_while([&TokBuf, &InitStart](const syntax::Token &Tok) { in getDeletionRange()
328 llvm::find_if(llvm::reverse(Toks), [](const syntax::Token &Tok) { in getDeletionRange()
331 assert(Tok != Toks.rend()); in getDeletionRange()
DAddUsing.cpp184 auto Toks = Inputs.AST->getTokens().expandedTokens(ND->getSourceRange()); in findInsertionPoint() local
185 const auto *Tok = llvm::find_if(Toks, [](const syntax::Token &Tok) { in findInsertionPoint()
188 if (Tok == Toks.end() || Tok->endLocation().isInvalid()) { in findInsertionPoint()
/external/clang/include/clang/AST/
DCommentParser.h73 void putBack(ArrayRef<Token> Toks) { in putBack() argument
74 if (Toks.empty()) in putBack()
78 MoreLATokens.append(Toks.rbegin(), std::prev(Toks.rend())); in putBack()
80 Tok = Toks[0]; in putBack()
/external/llvm-project/clang/include/clang/AST/
DCommentParser.h72 void putBack(ArrayRef<Token> Toks) { in putBack() argument
73 if (Toks.empty()) in putBack()
77 MoreLATokens.append(Toks.rbegin(), std::prev(Toks.rend())); in putBack()
79 Tok = Toks[0]; in putBack()
/external/llvm-project/clang/unittests/Tooling/Syntax/
DTreeTestBase.cpp163 ArrayRef<syntax::Token> Toks = tokens(Root); in nodeByRange() local
165 if (Toks.front().location().isFileID() && Toks.back().location().isFileID() && in nodeByRange()
166 syntax::Token::range(*SourceMgr, Toks.front(), Toks.back()) == in nodeByRange()
/external/llvm-project/clang/lib/Lex/
DPragma.cpp151 auto Toks = std::make_unique<Token[]>(Tokens.size()); in revert() local
152 std::copy(Tokens.begin() + 1, Tokens.end(), Toks.get()); in revert()
153 Toks[Tokens.size() - 1] = Tok; in revert()
154 Self.EnterTokenStream(std::move(Toks), Tokens.size(), in revert()
209 TokenCollector Toks = {*this, InMacroArgPreExpansion, {}, Tok}; in Handle_Pragma() local
215 Toks.lex(); in Handle_Pragma()
222 Toks.lex(); in Handle_Pragma()
250 Toks.lex(); in Handle_Pragma()
258 Toks.revert(); in Handle_Pragma()
344 TokenCollector Toks = {*this, InMacroArgPreExpansion, {}, Tok}; in HandleMicrosoft__pragma() local
[all …]
DPPLexerChange.cpp153 void Preprocessor::EnterTokenStream(const Token *Toks, unsigned NumToks, in EnterTokenStream() argument
162 Toks, Toks + NumToks); in EnterTokenStream()
164 delete [] Toks; in EnterTokenStream()
171 EnterTokenStream(Toks, NumToks, DisableMacroExpansion, OwnsTokens, in EnterTokenStream()
181 Toks, NumToks, DisableMacroExpansion, OwnsTokens, IsReinject, *this); in EnterTokenStream()
184 TokLexer->Init(Toks, NumToks, DisableMacroExpansion, OwnsTokens, in EnterTokenStream()
DPreprocessor.cpp1079 void Preprocessor::CollectPpImportSuffix(SmallVectorImpl<Token> &Toks) { in CollectPpImportSuffix() argument
1085 Toks.emplace_back(); in CollectPpImportSuffix()
1086 Lex(Toks.back()); in CollectPpImportSuffix()
1088 switch (Toks.back().getKind()) { in CollectPpImportSuffix()
1152 auto EnterTokens = [this](ArrayRef<Token> Toks) { in LexAfterModuleImport() argument
1153 auto ToksCopy = std::make_unique<Token[]>(Toks.size()); in LexAfterModuleImport()
1154 std::copy(Toks.begin(), Toks.end(), ToksCopy.get()); in LexAfterModuleImport()
1155 EnterTokenStream(std::move(ToksCopy), Toks.size(), in LexAfterModuleImport()
/external/llvm-project/clang/lib/Format/
DTokenAnalyzer.cpp73 ArrayRef<FormatToken *> Toks(Lex.lex()); in process() local
74 SmallVector<FormatToken *, 10> Tokens(Toks.begin(), Toks.end()); in process()
/external/llvm-project/clang/unittests/Lex/
DDependencyDirectivesSourceMinimizerTest.cpp698 SmallVector<Token, 32> Toks; in TEST() local
703 ASSERT_FALSE(minimizeSourceToDependencyDirectives(Source, Out, Toks)); in TEST()
705 ASSERT_FALSE(computeSkippedRanges(Toks, Ranges)); in TEST()
713 SmallVector<Token, 32> Toks; in TEST() local
724 ASSERT_FALSE(minimizeSourceToDependencyDirectives(Source, Out, Toks)); in TEST()
726 ASSERT_FALSE(computeSkippedRanges(Toks, Ranges)); in TEST()
/external/clang/lib/Lex/
DPPLexerChange.cpp191 void Preprocessor::EnterTokenStream(const Token *Toks, unsigned NumToks, in EnterTokenStream() argument
199 Toks, Toks + NumToks); in EnterTokenStream()
201 delete [] Toks; in EnterTokenStream()
208 EnterTokenStream(Toks, NumToks, DisableMacroExpansion, OwnsTokens); in EnterTokenStream()
217 Toks, NumToks, DisableMacroExpansion, OwnsTokens, *this); in EnterTokenStream()
220 TokLexer->Init(Toks, NumToks, DisableMacroExpansion, OwnsTokens); in EnterTokenStream()
/external/llvm-project/clang/lib/AST/
DCommentParser.cpp38 SmallVector<Token, 16> Toks; member in clang::comments::TextTokenRetokenizer
53 return Pos.CurToken >= Toks.size(); in isEnd()
59 const Token &Tok = Toks[Pos.CurToken]; in setupBuffer()
114 Toks.push_back(P.Tok); in addToken()
116 if (Toks.size() == 1) in addToken()
248 P.putBack(llvm::makeArrayRef(Toks.begin() + Pos.CurToken, Toks.end())); in putBackLeftoverTokens()
249 Pos.CurToken = Toks.size(); in putBackLeftoverTokens()
/external/clang/lib/AST/
DCommentParser.cpp39 SmallVector<Token, 16> Toks; member in clang::comments::TextTokenRetokenizer
54 return Pos.CurToken >= Toks.size(); in isEnd()
60 const Token &Tok = Toks[Pos.CurToken]; in setupBuffer()
115 Toks.push_back(P.Tok); in addToken()
117 if (Toks.size() == 1) in addToken()
249 P.putBack(llvm::makeArrayRef(Toks.begin() + Pos.CurToken, Toks.end())); in putBackLeftoverTokens()
250 Pos.CurToken = Toks.size(); in putBackLeftoverTokens()
/external/clang/include/clang/Parse/
DParser.h898 bool SkipUntil(ArrayRef<tok::TokenKind> Toks,
954 CachedTokens Toks; member
985 CachedTokens Toks; member
1004 CachedTokens *Toks = nullptr)
1005 : Param(P), Toks(Toks) { } in Param()
1014 CachedTokens *Toks; member
1066 CachedTokens Toks; member
1192 void LexTemplateFunctionForLateParsing(CachedTokens &Toks);
1227 bool ConsumeAndStoreFunctionPrologue(CachedTokens &Toks);
1228 bool ConsumeAndStoreInitializer(CachedTokens &Toks, CachedInitKind CIK);
[all …]
/external/llvm-project/clang/include/clang/Parse/
DParser.h1214 bool SkipUntil(ArrayRef<tok::TokenKind> Toks,
1277 CachedTokens Toks; member
1299 CachedTokens Toks; variable
1305 void takeToks(CachedTokens &Cached) { Toks.swap(Cached); } in takeToks()
1306 const CachedTokens &toks() const { return Toks; } in toks()
1329 CachedTokens Toks; member
1342 std::unique_ptr<CachedTokens> Toks = nullptr)
1343 : Param(P), Toks(std::move(Toks)) { } in Param()
1352 std::unique_ptr<CachedTokens> Toks; member
1398 CachedTokens Toks; member
[all …]
/external/llvm-project/clang-tools-extra/clangd/unittests/
DSemanticHighlightingTests.cpp68 std::vector<HighlightingToken> Toks = makeHighlightingTokens( in getExpectedTokens() local
70 ExpectedTokens.insert(ExpectedTokens.end(), Toks.begin(), Toks.end()); in getExpectedTokens()

123