Path: blob/main/contrib/llvm-project/clang/lib/Tooling/Syntax/TokenBufferTokenManager.cpp
35271 views
//===- TokenBufferTokenManager.cpp ----------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "clang/Tooling/Syntax/TokenBufferTokenManager.h"910namespace clang {11namespace syntax {12constexpr llvm::StringLiteral syntax::TokenBufferTokenManager::Kind;1314std::pair<FileID, ArrayRef<syntax::Token>>15syntax::TokenBufferTokenManager::lexBuffer(16std::unique_ptr<llvm::MemoryBuffer> Input) {17auto FID = SM.createFileID(std::move(Input));18auto It = ExtraTokens.try_emplace(FID, tokenize(FID, SM, LangOpts));19assert(It.second && "duplicate FileID");20return {FID, It.first->second};21}2223} // namespace syntax24} // namespace clang252627