clang-tools
9.0.0
|
Stores and provides access to parsed AST. More...
#include <ClangdUnit.h>
Public Member Functions | |
ParsedAST (ParsedAST &&Other) | |
ParsedAST & | operator= (ParsedAST &&Other) |
~ParsedAST () | |
ASTContext & | getASTContext () |
Note that the returned ast will not contain decls from the preamble that were not deserialized during parsing. More... | |
const ASTContext & | getASTContext () const |
Preprocessor & | getPreprocessor () |
std::shared_ptr< Preprocessor > | getPreprocessorPtr () |
const Preprocessor & | getPreprocessor () const |
SourceManager & | getSourceManager () |
const SourceManager & | getSourceManager () const |
ArrayRef< Decl * > | getLocalTopLevelDecls () |
This function returns top-level decls present in the main file of the AST. More... | |
const std::vector< Diag > & | getDiagnostics () const |
std::size_t | getUsedBytes () const |
Returns the esitmated size of the AST and the accessory structures, in bytes. More... | |
const IncludeStructure & | getIncludeStructure () const |
const CanonicalIncludes & | getCanonicalIncludes () const |
const syntax::TokenBuffer & | getTokens () const |
Tokens recorded while parsing the main file. More... | |
Static Public Member Functions | |
static llvm::Optional< ParsedAST > | build (std::unique_ptr< clang::CompilerInvocation > CI, std::shared_ptr< const PreambleData > Preamble, std::unique_ptr< llvm::MemoryBuffer > Buffer, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, const SymbolIndex *Index, const ParseOptions &Opts) |
Attempts to run Clang and store parsed AST. More... | |
Stores and provides access to parsed AST.
Definition at line 73 of file ClangdUnit.h.
|
default |
clang::clangd::ParsedAST::~ParsedAST | ( | ) |
Definition at line 466 of file ClangdUnit.cpp.
References Action.
|
static |
Attempts to run Clang and store parsed AST.
If Preamble
is non-null it is reused during parsing.
Definition at line 287 of file ClangdUnit.cpp.
ASTContext & clang::clangd::ParsedAST::getASTContext | ( | ) |
Note that the returned ast will not contain decls from the preamble that were not deserialized during parsing.
Clients should expect only decls from the main file to be in the AST.
Definition at line 477 of file ClangdUnit.cpp.
Referenced by clang::clangd::findDecl(), clang::clangd::getBeginningOfIdentifier(), clang::clangd::getTypeHierarchy(), and clang::clangd::indexMainDecls().
const ASTContext & clang::clangd::ParsedAST::getASTContext | ( | ) | const |
Definition at line 479 of file ClangdUnit.cpp.
const CanonicalIncludes & clang::clangd::ParsedAST::getCanonicalIncludes | ( | ) | const |
Definition at line 535 of file ClangdUnit.cpp.
Referenced by clang::clangd::indexMainDecls().
const std::vector< Diag > & clang::clangd::ParsedAST::getDiagnostics | ( | ) | const |
Definition at line 497 of file ClangdUnit.cpp.
const IncludeStructure & clang::clangd::ParsedAST::getIncludeStructure | ( | ) | const |
Definition at line 531 of file ClangdUnit.cpp.
llvm::ArrayRef< Decl * > clang::clangd::ParsedAST::getLocalTopLevelDecls | ( | ) |
This function returns top-level decls present in the main file of the AST.
The result does not include the decls that come from the preamble. (These should be const, but RecursiveASTVisitor requires Decl*).
Definition at line 493 of file ClangdUnit.cpp.
Referenced by clang::clangd::indexMainDecls().
Preprocessor & clang::clangd::ParsedAST::getPreprocessor | ( | ) |
Definition at line 483 of file ClangdUnit.cpp.
const Preprocessor & clang::clangd::ParsedAST::getPreprocessor | ( | ) | const |
Definition at line 489 of file ClangdUnit.cpp.
std::shared_ptr< Preprocessor > clang::clangd::ParsedAST::getPreprocessorPtr | ( | ) |
Definition at line 485 of file ClangdUnit.cpp.
Referenced by clang::clangd::indexMainDecls().
|
inline |
Definition at line 99 of file ClangdUnit.h.
Referenced by clang::clangd::findRecordTypeAt().
|
inline |
Definition at line 102 of file ClangdUnit.h.
|
inline |
Tokens recorded while parsing the main file.
(!) does not have tokens from the preamble.
Definition at line 121 of file ClangdUnit.h.
std::size_t clang::clangd::ParsedAST::getUsedBytes | ( | ) | const |
Returns the esitmated size of the AST and the accessory structures, in bytes.
Does not include the size of the preamble.
Definition at line 499 of file ClangdUnit.cpp.
References clang::clangd::AST.