clang-tools
7.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< vfs::FileSystem > VFS) |
Attempts to run Clang and store parsed AST. More... | |
Stores and provides access to parsed AST.
Definition at line 66 of file ClangdUnit.h.
|
default |
ParsedAST::~ParsedAST | ( | ) |
Definition at line 184 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 124 of file ClangdUnit.cpp.
References Action, clang::clangd::collectIncludeStructureCallback(), clang::clangd::StoreDiags::EndSourceFile(), clang::clangd::log(), clang::clangd::None, and clang::clangd::prepareCompilerInstance().
ASTContext & 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 190 of file ClangdUnit.cpp.
Referenced by clang::clangd::dumpAST(), clang::clangd::getBeginningOfIdentifier(), and clang::clangd::getDocumentSymbols().
const ASTContext & ParsedAST::getASTContext | ( | ) | const |
Definition at line 192 of file ClangdUnit.cpp.
const std::vector< Diag > & ParsedAST::getDiagnostics | ( | ) | const |
Definition at line 210 of file ClangdUnit.cpp.
const IncludeStructure & ParsedAST::getIncludeStructure | ( | ) | const |
Definition at line 244 of file ClangdUnit.cpp.
ArrayRef< Decl * > 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 206 of file ClangdUnit.cpp.
Referenced by clang::clangd::getDocumentSymbols().
Preprocessor & ParsedAST::getPreprocessor | ( | ) |
Definition at line 196 of file ClangdUnit.cpp.
const Preprocessor & ParsedAST::getPreprocessor | ( | ) | const |
Definition at line 202 of file ClangdUnit.cpp.
std::shared_ptr< Preprocessor > ParsedAST::getPreprocessorPtr | ( | ) |
Definition at line 198 of file ClangdUnit.cpp.
std::size_t 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 212 of file ClangdUnit.cpp.
References clang::clangd::AST.