Skip to content

Commit

Permalink
Remove libclang
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jul 16, 2018
1 parent 344f00f commit 73ac788
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cmake/FindClang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions src/indexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -1086,13 +1085,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,
Expand Down
2 changes: 0 additions & 2 deletions src/indexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions src/project.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 73ac788

Please sign in to comment.