Remove libclang

This commit is contained in:
Fangrui Song 2018-07-15 21:01:10 -07:00
parent af77e6615d
commit 134a09a255
4 changed files with 2 additions and 14 deletions

View File

@ -68,9 +68,8 @@ set(_Clang_REQUIRED_VARS Clang_LIBRARY Clang_INCLUDE_DIR Clang_EXECUTABLE
Clang_RESOURCE_DIR Clang_VERSION
LLVM_INCLUDE_DIR LLVM_BUILD_INCLUDE_DIR)
_Clang_find_library(Clang_LIBRARY clang)
_Clang_find_library(Clang_LIBRARY clangIndex)
_Clang_find_add_library(clangTooling)
_Clang_find_add_library(clangIndex)
_Clang_find_add_library(clangFrontend)
_Clang_find_add_library(clangParse)
_Clang_find_add_library(clangSerialization)

View File

@ -6,7 +6,6 @@
#include "serializer.h"
using ccls::Intern;
#include <clang-c/Index.h>
#include <clang/AST/AST.h>
#include <clang/Frontend/ASTUnit.h>
#include <clang/Frontend/CompilerInstance.h>
@ -1083,13 +1082,6 @@ void Uniquify(std::vector<Use>& uses) {
namespace ccls::idx {
void IndexInit() {
// This calls llvm::InitializeAllTargets() ... for us, we would otherwise link
// all target libraries.
CXIndex CXIdx = clang_createIndex(0, 0);
clang_disposeIndex(CXIdx);
}
std::vector<std::unique_ptr<IndexFile>> Index(
VFS* vfs,
const std::string& opt_wdir,

View File

@ -295,8 +295,6 @@ struct IndexFile {
};
namespace ccls::idx {
void IndexInit();
std::vector<std::unique_ptr<IndexFile>>
Index(VFS *vfs, const std::string &opt_wdir, const std::string &file,
const std::vector<std::string> &args,

View File

@ -154,8 +154,7 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry(
continue;
}
if (!sys::path::is_absolute(HeaderOpts.ResourceDir) &&
HeaderOpts.UseBuiltinIncludes)
if (!sys::fs::exists(HeaderOpts.ResourceDir) && HeaderOpts.UseBuiltinIncludes)
args.push_back("-resource-dir=" + g_config->clang.resourceDir);
if (CI->getFileSystemOpts().WorkingDir.empty())
args.push_back("-working-directory=" + entry.directory);