clang
10.0.0svn
|
A memory arena for syntax trees. More...
#include "clang/Tooling/Syntax/Tree.h"
Public Member Functions | |
Arena (SourceManager &SourceMgr, const LangOptions &LangOpts, TokenBuffer Tokens) | |
const SourceManager & | sourceManager () const |
const LangOptions & | langOptions () const |
const TokenBuffer & | tokenBuffer () const |
llvm::BumpPtrAllocator & | allocator () |
std::pair< FileID, llvm::ArrayRef< syntax::Token > > | lexBuffer (std::unique_ptr< llvm::MemoryBuffer > Buffer) |
Add Buffer to the underlying source manager, tokenize it and store the resulting tokens. More... | |
A memory arena for syntax trees.
Also tracks the underlying token buffers, source manager, etc.
syntax::Arena::Arena | ( | SourceManager & | SourceMgr, |
const LangOptions & | LangOpts, | ||
TokenBuffer | Tokens | ||
) |
|
inline |
Definition at line 48 of file Tree.h.
References lexBuffer().
|
inline |
Definition at line 45 of file Tree.h.
References tokenBuffer().
std::pair< FileID, llvm::ArrayRef< syntax::Token > > syntax::Arena::lexBuffer | ( | std::unique_ptr< llvm::MemoryBuffer > | Buffer | ) |
Add Buffer
to the underlying source manager, tokenize it and store the resulting tokens.
Useful when there is a need to materialize tokens that were not written in user code.
Definition at line 26 of file Tree.cpp.
References clang::SourceManager::createFileID(), and clang::syntax::tokenize().
Referenced by allocator().
|
inline |
Definition at line 44 of file Tree.h.
Referenced by clang::syntax::Node::dumpTokens().
const clang::syntax::TokenBuffer & syntax::Arena::tokenBuffer | ( | ) | const |
Definition at line 21 of file Tree.cpp.
Referenced by langOptions().