clang-tools
8.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 |
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 |
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, std::shared_ptr< PCHContainerOperations > PCHs, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS) |
Attempts to run Clang and store parsed AST. More... | |
Stores and provides access to parsed AST.
Definition at line 71 of file ClangdUnit.h.
|
default |
clang::clangd::ParsedAST::~ParsedAST | ( | ) |
Definition at line 337 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 227 of file ClangdUnit.cpp.
References Action, clang::clangd::log(), clang::clangd::None, and clang::clangd::prepareCompilerInstance().
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 348 of file ClangdUnit.cpp.
Referenced by clang::clangd::dumpAST(), clang::clangd::getBeginningOfIdentifier(), and clang::clangd::indexMainDecls().
const ASTContext & clang::clangd::ParsedAST::getASTContext | ( | ) | const |
Definition at line 350 of file ClangdUnit.cpp.
const std::vector< Diag > & clang::clangd::ParsedAST::getDiagnostics | ( | ) | const |
Definition at line 368 of file ClangdUnit.cpp.
const IncludeStructure & clang::clangd::ParsedAST::getIncludeStructure | ( | ) | const |
Definition at line 402 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 364 of file ClangdUnit.cpp.
Referenced by clang::clangd::indexMainDecls().
Preprocessor & clang::clangd::ParsedAST::getPreprocessor | ( | ) |
Definition at line 354 of file ClangdUnit.cpp.
const Preprocessor & clang::clangd::ParsedAST::getPreprocessor | ( | ) | const |
Definition at line 360 of file ClangdUnit.cpp.
std::shared_ptr< Preprocessor > clang::clangd::ParsedAST::getPreprocessorPtr | ( | ) |
Definition at line 356 of file ClangdUnit.cpp.
Referenced by clang::clangd::indexMainDecls().
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 370 of file ClangdUnit.cpp.
References clang::clangd::AST.