clang  11.0.0git
Public Member Functions | List of all members
clang::syntax::Arena Class Reference

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 SourceManagersourceManager () const
const LangOptionslangOptions () const
const TokenBuffertokenBuffer () 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...

Detailed Description

A memory arena for syntax trees.

Also tracks the underlying token buffers, source manager, etc.

Definition at line 39 of file Tree.h.

Constructor & Destructor Documentation

◆ Arena()

syntax::Arena::Arena ( SourceManager SourceMgr,
const LangOptions LangOpts,
TokenBuffer  Tokens 

Definition at line 35 of file Tree.cpp.

Member Function Documentation

◆ allocator()

llvm::BumpPtrAllocator& clang::syntax::Arena::allocator ( )

Definition at line 48 of file Tree.h.

References lexBuffer().

Referenced by clang::syntax::TreeBuilder::allocator().

◆ langOptions()

const LangOptions& clang::syntax::Arena::langOptions ( ) const

Definition at line 45 of file Tree.h.

References tokenBuffer().

◆ lexBuffer()

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 44 of file Tree.cpp.

References clang::SourceManager::createFileID(), and clang::syntax::tokenize().

Referenced by allocator().

◆ sourceManager()

const SourceManager& clang::syntax::Arena::sourceManager ( ) const

◆ tokenBuffer()

const clang::syntax::TokenBuffer & syntax::Arena::tokenBuffer ( ) const

The documentation for this class was generated from the following files: