21 #ifndef LLVM_CLANG_TOOLING_SYNTAX_TREE_CASCADE_H 22 #define LLVM_CLANG_TOOLING_SYNTAX_TREE_CASCADE_H 29 #include "llvm/ADT/ArrayRef.h" 30 #include "llvm/ADT/DenseMap.h" 31 #include "llvm/Support/Allocator.h" 48 llvm::BumpPtrAllocator &
allocator() {
return Allocator; }
53 std::pair<FileID, llvm::ArrayRef<syntax::Token>>
54 lexBuffer(std::unique_ptr<llvm::MemoryBuffer> Buffer);
61 llvm::DenseMap<FileID, std::vector<syntax::Token>> ExtraTokens;
63 llvm::BumpPtrAllocator Allocator;
91 std::string dumpTokens(
const Arena &A)
const;
134 friend class TreeBuilder;
136 Node *FirstChild =
nullptr;
const syntax::Token * token() const
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.
Defines the SourceManager interface.
A token coming directly from a file or from a macro invocation.
Node(NodeKind Kind)
Newly created nodes are detached from a tree, parent and sibling links are set when the node is added...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)
const SourceManager & sourceManager() const
llvm::BumpPtrAllocator & allocator()
const LangOptions & langOptions() const
const TokenBuffer & tokenBuffer() const
A memory arena for syntax trees.
Defines the clang::LangOptions interface.
const Node * nextSibling() const
A node that has children and represents a syntactic language construct.
NodeKind
A kind of a syntax node, used for implementing casts.
const Tree * parent() const
ast_type_traits::DynTypedNode Node
NodeRole
A relation between a parent and child node. Used for implementing accessors.
Dataflow Directional Tag Classes.
Arena(SourceManager &SourceMgr, const LangOptions &LangOpts, TokenBuffer Tokens)
A leaf node points to a single token inside the expanded token stream.
static bool classof(const OMPClause *T)
Defines the clang::TokenKind enum and support functions.
Defines the clang::SourceLocation class and associated facilities.
A list of tokens obtained by preprocessing a text buffer and operations to map between the expanded a...
const Node * firstChild() const
This class handles loading and caching of source files into memory.