From 5ad3013b60768ead5438136085a3441e78f34000 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Fri, 2 Nov 2018 15:36:41 -0700 Subject: [PATCH] compile_commands.json: add clang.excludeArgs for Linux --- Getting-started.md | 9 +++++++++ compile_commands.json.md | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/Getting-started.md b/Getting-started.md index 76a7030..2eb0e69 100644 --- a/Getting-started.md +++ b/Getting-started.md @@ -99,6 +99,15 @@ If your project is compiled with MSVC, you may change the compiler driver (`%cla See https://clang.llvm.org/docs/MSVCCompatibility.html +### Standalone mode + +ccls indexer can be used standalone. The following command indexes the project and creates `~/llvm/.ccls-cache/`. +If you have `clang.extraArgs`, make sure your client uses the same initialization option, otherwise cflags mismatch will cause re-indexing. + +```zsh +ccls -index ~/llvm -init='{"clang":{"extraArgs": ["--gcc-toolchain=/usr"]}}' +``` + ### Cases On a laptop with one (i7-6600U CPU @ 2.60GHz, hyper-threading, `nproc`=4), 4 indexers. diff --git a/compile_commands.json.md b/compile_commands.json.md index 2da4325..bb53f56 100644 --- a/compile_commands.json.md +++ b/compile_commands.json.md @@ -114,6 +114,14 @@ yes '' | make config bear make -j bzImage modules ``` +```zsh +ccls -index ~/Dev/Linux -init='{"clang":{"excludeArgs":[ +"-falign-jumps=1","-falign-loops=1","-fconserve-stack","-fmerge-constants","-fno-code-hoisting","-fno-schedule-insns","-fno-var-tracking-assignments", +"-mhard-float","-mindirect-branch-register","-mindirect-branch=thunk-inline","-mpreferred-stack-boundary=2","-mpreferred-stack-boundary=3","-mpreferred-stack-boundary=4","-mrecord-mcount","-mindirect-branch=thunk-extern","-mno-fp-ret-in-387","-mskip-rax-setup", +"--param=allow-store-data-races=0","-Wa,arch/x86/kernel/macros.s","-Wa,-" +], "extraArgs":["--gcc-toolchain=/usr"]}}' +``` + ### musl ```zsh