[PATCH] D31019: [clangd] [RFC] Use libclang and CXTranslationUnit instead of ASTUnit
Benjamin Kramer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 16 09:36:18 PDT 2017
bkramer added a comment.
libclang is supposed to be used for bindings to other languages (it's a pure C interface) and its stable. ASTUnit is the C++ side of libclang, libclang is just a thin wrapper around ASTUnit. ASTUnit itself suffers from lots of technical debt because clang changed since ASTUnit was created and ASTUnit was never refactored to accommodate that.
Even in the current state using ASTUnit gives you more control over clang, e.g. it lets you use the VFS which is not exposed in libclang. At some point we're going to need a cleaner replacement for ASTUnit, but currently it's the only place in clang that supports the precompiled preamble needed for speedy code completion.
More information about the cfe-commits