From 134a09a255366f601a070713b74bdbadb2f8a7b6 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 15 Jul 2018 21:01:10 -0700 Subject: [PATCH] Remove libclang --- cmake/FindClang.cmake | 3 +-- src/indexer.cc | 8 -------- src/indexer.h | 2 -- src/project.cc | 3 +-- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/cmake/FindClang.cmake b/cmake/FindClang.cmake index fe44ece1..87ab72b5 100644 --- a/cmake/FindClang.cmake +++ b/cmake/FindClang.cmake @@ -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) diff --git a/src/indexer.cc b/src/indexer.cc index e047e1dc..126da193 100644 --- a/src/indexer.cc +++ b/src/indexer.cc @@ -6,7 +6,6 @@ #include "serializer.h" using ccls::Intern; -#include #include #include #include @@ -1083,13 +1082,6 @@ void Uniquify(std::vector& 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> Index( VFS* vfs, const std::string& opt_wdir, diff --git a/src/indexer.h b/src/indexer.h index 793b49cd..99fbc921 100644 --- a/src/indexer.h +++ b/src/indexer.h @@ -295,8 +295,6 @@ struct IndexFile { }; namespace ccls::idx { -void IndexInit(); - std::vector> Index(VFS *vfs, const std::string &opt_wdir, const std::string &file, const std::vector &args, diff --git a/src/project.cc b/src/project.cc index da24705c..2777634c 100644 --- a/src/project.cc +++ b/src/project.cc @@ -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);