Closed SyrakuShaikh closed 5 years ago
by the way, I use the above commands/procedures building ccls
many times. In fact, every time ccls
updates, I'll build llvm+clang
and then ccls
. And in most times it just works.
../src/main.cc:81:19: error: no member named 'Categories' in 'llvm:cl:Option'
if (I.second->Categories[0] != &C)
~~~~~~~~ ^
1 error generated.
Your clang 9.0.0 is not new enough to include the change rL360179. Unfortunately there is no good way to make a ifdef that dispatches on the exact revision number, so you'll have to update (or make a local change to src/main.cc
until you can get an updated 9.0.0 snapshot). Here is the version information of my clang:
% clang --version
clang version 9.0.0 (trunk 363759) (llvm/trunk 363758)
// src/main.cc
#if LLVM_VERSION_MAJOR >= 9 // rL360179
if (I.second->Categories[0] != &C)
#else
if (I.second->Category != &C)
#endif
sorry to rely on this closed issue.
I rebuilt llvm+clang
and then ccls
on 06/24. That 'Categeries' problem is fixed, however, new error occurs.
[13/43] Building CXX object CMakeFiles/ccls.dir/src/message_handler.cc.o
FAILED: CMakeFiles/ccls.dir/src/message_handler.cc.o
/home/shaikh/Public/llvm-project/release/bin/clang++ -I../src -isystem ../third_party -isystem /home/shaikh/Public/llvm-project/release/include -isystem ../third_party/rapidjson/include -march=native -O3 -flto=thin -O3 -DNDEBUG -Wall -Wno-sign-compare -pthread -std=c++17 -MD -MT CMakeFiles/ccls.dir/src/message_handler.cc.o -MF CMakeFiles/ccls.dir/src/message_handler.cc.o.d -o CMakeFiles/ccls.dir/src/message_handler.cc.o -c ../src/message_handler.cc
clang-9: /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/APValue.cpp:744: bool clang::APValue::isNullPointer() const: Assertion `isLValue() && "Invalid usage"' failed.
My llvm
trunk: 3641215
My clang
trunk: 364202
Just report these messages here, I'll build this toolchain again:)
clang-9: /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/APValue.cpp:744: bool clang::APValue::isNullPointer() const: Assertion `isLValue() && "Invalid usage"' failed.
It sounds like you are using a clang build with -DLLVM_ENABLE_ASSERTIONS=on
(it defaults to ON for debug builds). The clang upstream is not so unstable.. You may resync your clang
Would you like to share your script for building the latest llvm+clang
? Thanks:)
@SyrakuShaikh https://github.com/MaskRay/ccls/wiki/Project-Setup#llvm-multirepo + https://github.com/MaskRay/Config/wiki#llvm
# I actually use a distcc like compiler scheduler, instead of ~/llvm/Stable/bin/clang
LLVM_COMMON=(-GNinja -DCMAKE_CXX_COMPILER=$HOME/llvm/Stable/bin/clang++ -DCMAKE_C_COMPILER=$HOME/llvm/Stable/bin/clang -DBUILD_SHARED_LIBS=On -DLLVM_ENABLE_LLD=On -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_DOCS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLDB_TEST_C_COMPILER=~/llvm/Stable/bin/clang -DLLDB_TEST_CXX_COMPILER=~/llvm/Stable/bin/clang++)
cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release ${LLVM_COMMON}
cmake -H. -BDebug -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXE_LINKER_FLAGS=-Wl,--gdb-index -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--gdb-index -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_OPTIMIZED_TABLEGEN=On -DLLVM_USE_SPLIT_DWARF=On ${LLVM_COMMON}
OS: Archlinux up-to-date, not in testing channel.
LLVM+Clang:
Configuring CMake for ccls...
-- The CXX compiler identification is Clang 9.0.0 -- Check for working CXX compiler: /home/shaikh/Public/llvm-project/release/bin/clang++ -- Check for working CXX compiler: /home/shaikh/Public/llvm-project/release/bin/clang++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for C++ include pthread.h -- Looking for C++ include pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE -- Configuring done -- Build files have been written to: /home/shaikh/Public/ccls/release
Successfully configure CMake!
[6/43] Building CXX object CMakeFiles/ccls.dir/src/main.cc.o FAILED: CMakeFiles/ccls.dir/src/main.cc.o /home/shaikh/Public/llvm-project/release/bin/clang++ -DCCLS_VERSION=\"0.20190314.1-12-g9f25474e\" -I../src -isystem ../third_party -isystem /home/shaikh/Public/llvm-project/release/include -isystem ../third_party/rapidjson/include -march=native -O3 -flto=thin -O3 -DNDEBUG -Wall -Wno-sign-compare -pthread -std=c++17 -MD -MT CMakeFiles/ccls.dir/src/main.cc.o -MF CMakeFiles/ccls.dir/src/main.cc.o.d -o CMakeFiles/ccls.dir/src/main.cc.o -c ../src/main.cc ../src/main.cc:81:19: error: no member named 'Categories' in 'llvm::cl::Option'; did you mean 'getCategories'? if (I.second->Categories[0] != &C) ^
~~~~~ getCategories /home/shaikh/Public/llvm-project/release/include/llvm/Support/CommandLine.h:290:36: note: 'getCategories' declared here SmallPtrSet<OptionCategory *, 1> getCategories() const; ^ ../src/main.cc:81:19: error: reference to non-static member function must be called; did you mean to call it with no arguments? if (I.second->Categories[0] != &C)