Lines Matching full:expanded

57 // Finds the range within FID corresponding to expanded tokens [First, Last].
71 // - identifying which spelled range covers the expanded tokens
74 // We do these in order. However as we transform the expanded range into the
247 // AST. Ranges in AST are token ranges from expanded token stream.
271 TokenBuffer::spelledForExpandedToken(const syntax::Token *Expanded) const {
272 assert(Expanded);
273 assert(ExpandedTokens.data() <= Expanded &&
274 Expanded < ExpandedTokens.data() + ExpandedTokens.size());
277 SourceMgr->getFileID(SourceMgr->getExpansionLoc(Expanded->location())));
278 assert(FileIt != Files.end() && "no file for an expanded token");
282 unsigned ExpandedIndex = Expanded - ExpandedTokens.data();
283 // Find the first mapping that produced tokens after \p Expanded.
399 llvm::formatv("spelled tokens: [{0},{1}), expanded tokens: [{2},{3})",
404 TokenBuffer::spelledForExpanded(llvm::ArrayRef<syntax::Token> Expanded) const {
408 if (!Expanded.empty() && Expanded.back().kind() == tok::eof) {
409 Expanded = Expanded.drop_back();
413 if (Expanded.empty())
415 const syntax::Token *First = &Expanded.front();
416 const syntax::Token *Last = &Expanded.back();
448 unsigned FirstExpanded = Expanded.begin() - ExpandedTokens.data();
449 unsigned LastExpanded = Expanded.end() - ExpandedTokens.data();
466 E.Expanded = llvm::ArrayRef(ExpandedTokens.data() + M.BeginExpanded,
629 // Only record top-level expansions that directly produce expanded tokens.
638 // Both A and B produce expanded tokens, though the macro name 'B' comes
673 /// - for each token, figures out if it is a part of an expanded token stream,
675 /// - records mappings from the spelled to expanded token ranges, e.g. for macro
684 // Collect the expanded token stream during preprocessing.
695 Expanded.push_back(syntax::Token(T));
704 /// Builds mappings and spelled tokens in the TokenBuffer based on the expanded
708 Builder(std::vector<syntax::Token> Expanded, PPExpansions CollectedExpansions,
712 Result.ExpandedTokens = std::move(Expanded);
719 // Tokenize every file that contributed tokens to the expanded stream.
722 // The expanded token stream consists of runs of tokens that came from
727 // Create empty mappings for spelled tokens that expanded to nothing here.
730 // Create mapping for a contiguous run of expanded tokens.
775 // be positioned within the file's expanded-token range (at the end).
819 // A run of file tokens continues while the expanded/spelled tokens match.
827 // We need no mapping for file tokens copied to the expanded stream.
841 // ... consumes expanded tokens rooted at the same expansion ...
864 llvm_unreachable("Couldn't map expanded token to spelled tokens!");
867 /// Initializes TokenBuffer::Files and fills spelled tokens and expanded
898 return Builder(std::move(Expanded), std::move(Expansions),
937 OS << "expanded tokens:\n"