MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.78k stars 260 forks source link

clang 9.0.0 before rL360179: error: no member named 'Categories' in 'llvm:cl:Option' #424

Closed SyrakuShaikh closed 5 years ago

SyrakuShaikh commented 5 years ago
  1. OS: Archlinux up-to-date, not in testing channel.

  2. LLVM+Clang:

  1. ccls building commands:
    DSTDIR="$HOME/Public"
    LLVMBUILD="$DSTDIR/llvm-project/release"
    ##
    LIBD="$("$LLVMBUILD/bin/clang++" -print-search-dirs | /usr/bin/rg --smart-case 'libraries...(.*?):.*' --replace "\$1")"
    LD_FLAGS=""
    LD_FLAGS="${LD_FLAGS} -B$LLVMBUILD/bin -fuse-ld=lld -L$LLVMBUILD/lib -L$LIBD/lib"
    LD_FLAGS="${LD_FLAGS} -Wl,-L$LLVMBUILD/lib -Wl,-L$LIBD/lib -Wl,-rpath=$LLVMBUILD/lib"
    ##
    CXX_FLAGS=""
    CXX_FLAGS="${CXX_FLAGS} -march=native -O3 -flto=thin"
cmake -H. \
    -Brelease -G Ninja -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_COMPILER="$LLVMBUILD/bin/clang" \
    -DCMAKE_CXX_COMPILER="$LLVMBUILD/bin/clang++" \
    -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
    -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
    -DCMAKE_AR="$LLVMBUILD/bin/llvm-ar" \
    -DCMAKE_RANLIB="$LLVMBUILD/bin/llvm-ranlib" \
    -DCMAKE_NM="$LLVMBUILD/bin/llvm-nm" \
    -DCMAKE_LINKER="$LLVMBUILD/bin/ld.lld" \
    -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
    -DLLVM_ENABLE_RTTI:BOOL=ON \
    -DCMAKE_PREFIX_PATH="$FULL_BUILD;$FULL_SRC"
  1. build failed -- logs
    
    ## Cloning new up-to-date ccls...
    ## Cloning into 'ccls'...
    remote: Enumerating objects: 18248, done.
    remote: Total 18248 (delta 0), reused 0 (delta 0), pack-reused 18248
    Receiving objects: 100% (18248/18248), 3.87 MiB | 1.68 MiB/s, done.
    Resolving deltas: 100% (15065/15065), done.
    ## Success!
    Initiating submodule...
    Submodule 'third_party/rapidjson' (https://github.com/Tencent/rapidjson) registered for path 'third_party/rapidjson'
    Cloning into '/home/shaikh/Public/ccls/third_party/rapidjson'...
    Submodule path 'third_party/rapidjson': checked out '6a905f9311f82d306da77bd963ec5aa5da07da9c'
    ## Success!
    ## Building ccls using compiled-from-svn-source-code clang+llvm...

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)


                            ()
../src/main.cc:81:29: error: type 'SmallPtrSet<llvm::cl::OptionCategory *, 1>' does not provide a subscript operator
    if (I.second->Categories[0] != &C)
        ~~~~~~~~~~~~~~~~~~~~^~
3 errors generated.
[10/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.
Stack dump:
0.  Program arguments: /home/shaikh/Public/llvm-project/release/bin/clang-9 -cc1 -triple x86_64-pc-linux-gnu -emit-llvm-bc -flto=thin -flto-unit -disable-free -main-file-name message_handler.cc -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu broadwell -target-feature +sse2 -target-feature +cx16 -target-feature +sahf -target-feature -tbm -target-feature -avx512ifma -target-feature -sha -target-feature -gfni -target-feature -fma4 -target-feature -vpclmulqdq -target-feature +prfchw -target-feature +bmi2 -target-feature -cldemote -target-feature +fsgsbase -target-feature -ptwrite -target-feature -xsavec -target-feature +popcnt -target-feature -mpx -target-feature +aes -target-feature -avx512bitalg -target-feature -movdiri -target-feature -xsaves -target-feature -avx512er -target-feature -avx512vnni -target-feature -avx512vpopcntdq -target-feature -pconfig -target-feature -clwb -target-feature -avx512f -target-feature -clzero -target-feature -pku -target-feature +mmx -target-feature -lwp -target-feature -rdpid -target-feature -xop -target-feature +rdseed -target-feature -waitpkg -target-feature -movdir64b -target-feature -sse4a -target-feature -avx512bw -target-feature -clflushopt -target-feature +xsave -target-feature -avx512vbmi2 -target-feature +64bit -target-feature -avx512vl -target-feature +invpcid -target-feature -avx512cd -target-feature +avx -target-feature -vaes -target-feature +cx8 -target-feature +fma -target-feature +rtm -target-feature +bmi -target-feature -enqcmd -target-feature +rdrnd -target-feature -mwaitx -target-feature +sse4.1 -target-feature +sse4.2 -target-feature +avx2 -target-feature +fxsr -target-feature -wbnoinvd -target-feature +sse -target-feature +lzcnt -target-feature +pclmul -target-feature -prefetchwt1 -target-feature +f16c -target-feature +ssse3 -target-feature -sgx -target-feature -shstk -target-feature +cmov -target-feature -avx512vbmi -target-feature -avx512bf16 -target-feature +movbe -target-feature +xsaveopt -target-feature -avx512dq -target-feature +adx -target-feature -avx512pf -target-feature +sse3 -dwarf-column-info -debugger-tuning=gdb -momit-leaf-frame-pointer -coverage-notes-file /home/shaikh/Public/ccls/release/CMakeFiles/ccls.dir/src/message_handler.cc.gcno -resource-dir /home/shaikh/Public/llvm-project/release/lib/clang/9.0.0 -dependency-file CMakeFiles/ccls.dir/src/message_handler.cc.o.d -sys-header-deps -MT CMakeFiles/ccls.dir/src/message_handler.cc.o -isystem ../third_party -isystem /home/shaikh/Public/llvm-project/release/include -isystem ../third_party/rapidjson/include -I ../src -D NDEBUG -I/opt/intel/compilers_and_libraries_2019.3.199/linux/ipp/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/mkl/include -ISUBSTITUTE_INSTALL_DIR_HERE/include -I/opt/intel/compilers_and_libraries_2019.3.199/linux/tbb/include -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0 -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/x86_64-pc-linux-gnu -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/backward -internal-isystem /usr/local/include -internal-isystem /home/shaikh/Public/llvm-project/release/lib/clang/9.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O3 -Wall -Wno-sign-compare -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /home/shaikh/Public/ccls/release -ferror-limit 19 -fmessage-length 0 -pthread -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-loops -vectorize-slp -faddrsig -o CMakeFiles/ccls.dir/src/message_handler.cc.o -x c++ ../src/message_handler.cc
1.  ../src/message_handler.cc:322:52: current parser token ')'
2.  ../src/message_handler.cc:33:1: parsing namespace 'ccls'
3.  ../src/message_handler.cc:294:73: parsing function body 'ccls::EmitSemanticHighlight'
4.  ../src/message_handler.cc:294:73: in compound statement ('{}')
5.  ../src/message_handler.cc:304:49: in compound statement ('{}')
6.  ../src/message_handler.cc:312:23: in compound statement ('{}')
7.  ../src/message_handler.cc:313:22: in compound statement ('{}')
 #0 0x00007fabadb607c4 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/shaikh/Public/llvm-project/llvm/lib/Support/Unix/Signals.inc:494:13
 #1 0x00007fabadb607c4 PrintStackTraceSignalHandler(void*) (.llvm.1612457232843005550) /home/shaikh/Public/llvm-project/llvm/lib/Support/Unix/Signals.inc:557:0
 #2 0x00007fabadb5dce0 llvm::sys::RunSignalHandlers() /home/shaikh/Public/llvm-project/llvm/lib/Support/Signals.cpp:69:18
 #3 0x00007fabadb60988 SignalHandler(int) /home/shaikh/Public/llvm-project/llvm/lib/Support/Unix/Signals.inc:357:1
 #4 0x00007fabad26b7e0 __restore_rt (/usr/lib/libc.so.6+0x3a7e0)
 #5 0x00007fabad26b755 raise (/usr/lib/libc.so.6+0x3a755)
 #6 0x00007fabad256851 abort (/usr/lib/libc.so.6+0x25851)
 #7 0x00007fabad256727 _nl_load_domain.cold (/usr/lib/libc.so.6+0x25727)
 #8 0x00007fabad264026 (/usr/lib/libc.so.6+0x33026)
 #9 0x00007fabac9b4e82 llvm::SmallBitVector::switchToLarge(llvm::BitVector*) /home/shaikh/Public/llvm-project/llvm/include/llvm/ADT/SmallBitVector.h:107:5
#10 0x00007fabac9b4e82 llvm::SmallBitVector::resize(unsigned int, bool) /home/shaikh/Public/llvm-project/llvm/include/llvm/ADT/SmallBitVector.h:341:0
#11 0x00007fabac9b4e82 EvaluateArgs(llvm::ArrayRef<clang::Expr const*>, llvm::SmallVector<clang::APValue, 8u>&, (anonymous namespace)::EvalInfo&, clang::FunctionDecl const*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:5100:0
#12 0x00007fabac9b3829 HandleFunctionCall(clang::SourceLocation, clang::FunctionDecl const*, (anonymous namespace)::LValue const*, llvm::ArrayRef<clang::Expr const*>, clang::Stmt const*, (anonymous namespace)::EvalInfo&, clang::APValue&, (anonymous namespace)::LValue const*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:5141:7
#13 0x00007fabaca02624 (anonymous namespace)::ExprEvaluatorBase<(anonymous namespace)::IntExprEvaluator>::handleCallExpr(clang::CallExpr const*, clang::APValue&, (anonymous namespace)::LValue const*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:5711:10
#14 0x00007fabac9d89e7 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::IntExprEvaluator, bool>::Visit(clang::Stmt const*) /home/shaikh/Public/llvm-project/llvm/tools/clang/include/clang/AST/StmtVisitor.h:0:0
#15 0x00007fabac9acadf Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:11677:9
#16 0x00007fabac9b0146 EvaluateAsRValue((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:11780:7
#17 0x00007fabac9b2550 llvm::SmallVectorBase::empty() const /home/shaikh/Public/llvm-project/llvm/include/llvm/ADT/SmallVector.h:55:47
#18 0x00007fabac9b2550 clang::Expr::isCXX11ConstantExpr(clang::ASTContext const&, clang::APValue*, clang::SourceLocation*) const /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:12609:0
#19 0x00007fabac9b0b0d EvaluateCPlusPlus11IntegralConstantExpr(clang::ASTContext const&, clang::Expr const*, llvm::APSInt*, clang::SourceLocation*) (.llvm.15431107558116438288) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:12529:7
#20 0x00007fabab8fab6a AnalyzeComparison(clang::Sema&, clang::BinaryOperator*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Sema/SemaChecking.cpp:10491:30
#21 0x00007fabab8fab6a AnalyzeImplicitConversions(clang::Sema&, clang::Expr*, clang::SourceLocation) (.llvm.3005219625900099877) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Sema/SemaChecking.cpp:11578:0
#22 0x00007fabab8fed48 clang::Sema::CheckImplicitConversions(clang::Expr*, clang::SourceLocation) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Sema/SemaChecking.cpp:11911:3
#23 0x00007fabab8fed48 clang::Sema::CheckCompletedExpr(clang::Expr*, clang::SourceLocation, bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Sema/SemaChecking.cpp:12478:0
#24 0x00007fababc29327 clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp:7851:7
#25 0x00007fababbb4ac0 clang::Sema::ActOnCondition(clang::Scope*, clang::SourceLocation, clang::Expr*, clang::Sema::ConditionKind) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Sema/SemaExpr.cpp:16880:8
#26 0x00007fabac0e76d1 clang::Parser::ParseCXXCondition(clang::ActionResult<clang::Stmt*, true>*, clang::SourceLocation, clang::Sema::ConditionKind, clang::Parser::ForRangeInfo*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp:0:20
#27 0x00007fabac1281df clang::Parser::ParseParenExprOrCondition(clang::ActionResult<clang::Stmt*, true>*, clang::Sema::ConditionResult&, clang::SourceLocation, clang::Sema::ConditionKind) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:0:0
#28 0x00007fabac121eb8 clang::Parser::ParseIfStatement(clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1217:7
#29 0x00007fabac11f552 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:239:12
#30 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#31 0x00007fabac1278c1 clang::Parser::ParseCompoundStatementBody(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1057:11
#32 0x00007fabac11f2e4 clang::Parser::ParseCompoundStatement(bool, unsigned int) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:880:10
#33 0x00007fabac11f2e4 clang::Parser::ParseCompoundStatement(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:845:0
#34 0x00007fabac11f2e4 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:232:0
#35 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#36 0x00007fabac1213e3 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:39:11
#37 0x00007fabac1213e3 clang::Parser::ParseCaseStatement(clang::Parser::ParsedStmtContext, bool, clang::ActionResult<clang::Expr*, true>) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:769:0
#38 0x00007fabac11f326 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:227:12
#39 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#40 0x00007fabac1278c1 clang::Parser::ParseCompoundStatementBody(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1057:11
#41 0x00007fabac11f2e4 clang::Parser::ParseCompoundStatement(bool, unsigned int) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:880:10
#42 0x00007fabac11f2e4 clang::Parser::ParseCompoundStatement(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:845:0
#43 0x00007fabac11f2e4 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:232:0
#44 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#45 0x00007fabac12270f clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:39:11
#46 0x00007fabac12270f clang::Parser::ParseSwitchStatement(clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1400:0
#47 0x00007fabac11f5b1 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:241:12
#48 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#49 0x00007fabac1278c1 clang::Parser::ParseCompoundStatementBody(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1057:11
#50 0x00007fabac11f2e4 clang::Parser::ParseCompoundStatement(bool, unsigned int) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:880:10
#51 0x00007fabac11f2e4 clang::Parser::ParseCompoundStatement(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:845:0
#52 0x00007fabac11f2e4 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:232:0
#53 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#54 0x00007fabac124ee5 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:39:11
#55 0x00007fabac124ee5 clang::Parser::ParseForStatement(clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1900:0
#56 0x00007fabac11f245 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:250:12
#57 0x00007fabac11e959 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:106:20
#58 0x00007fabac1278c1 clang::Parser::ParseCompoundStatementBody(bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1057:11
#59 0x00007fabac1286a8 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseStmt.cpp:2070:21
#60 0x00007fabac141f78 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/Parser.cpp:0:0
#61 0x00007fabac09b6ab clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseDecl.cpp:2041:16
#62 0x00007fabac141058 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/Parser.cpp:1095:10
#63 0x00007fabac140a95 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/Parser.cpp:1111:12
#64 0x00007fabac13fac2 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/Parser.cpp:931:12
#65 0x00007fabac0b2721 clang::AttributePool::~AttributePool() /home/shaikh/Public/llvm-project/llvm/tools/clang/include/clang/Sema/ParsedAttr.h:712:22
#66 0x00007fabac0b2721 clang::ParsedAttributes::~ParsedAttributes() /home/shaikh/Public/llvm-project/llvm/tools/clang/include/clang/Sema/ParsedAttr.h:906:0
#67 0x00007fabac0b2721 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:247:0
#68 0x00007fabac0b2101 clang::Parser::ParseScope::Exit() /home/shaikh/Public/llvm-project/llvm/tools/clang/include/clang/Parse/Parser.h:1020:11
#69 0x00007fabac0b2101 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:227:0
#70 0x00007fabac0965cb clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseDecl.cpp:0:0
#71 0x00007fabac13ef16 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/Parser.cpp:0:3
#72 0x00007fabac13d7ed clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/Parser.cpp:682:10
#73 0x00007fabac0833cd clang::ParseAST(clang::Sema&, bool, bool) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Parse/ParseAST.cpp:157:5
#74 0x00007fabaf2c9cd5 clang::CompilerInstance::shouldBuildGlobalModuleIndex() const /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:78:11
#75 0x00007fabaf2c9cd5 clang::FrontendAction::Execute() /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:938:0
#76 0x00007fabaf26690a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:945:11
#77 0x00007fabaf19769e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/shaikh/Public/llvm-project/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:291:25
#78 0x000000000021334d cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/shaikh/Public/llvm-project/llvm/tools/clang/tools/driver/cc1_main.cpp:250:15
#79 0x00000000002115d5 ExecuteCC1Tool(llvm::ArrayRef<char const*>, llvm::StringRef) /home/shaikh/Public/llvm-project/llvm/tools/clang/tools/driver/driver.cpp:309:12
#80 0x00000000002115d5 main /home/shaikh/Public/llvm-project/llvm/tools/clang/tools/driver/driver.cpp:381:0
#81 0x00007fabad257ee3 __libc_start_main (/usr/lib/libc.so.6+0x26ee3)
#82 0x000000000020e02e _start (/home/shaikh/Public/llvm-project/release/bin/clang-9+0x20e02e)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 9.0.0 (https://git.llvm.org/git/clang.git 4686697bfd2106d6f02d1f5bbf0fe33ca4105df5) (https://git.llvm.org/git/llvm.git a600636743291714a3afeeda8ae7f479b50913e7)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /home/shaikh/Public/llvm-project/release/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-9: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/message_handler-aa6269.cpp
clang-9: note: diagnostic msg: /tmp/message_handler-aa6269.sh
clang-9: note: diagnostic msg:

********************
[11/43] Building CXX object CMakeFiles/ccls.dir/src/indexer.cc.o
ninja: build stopped: subcommand failed.
```

5. I'll build ```llvm+clang``` and ```ccls``` in a few days and see if it fails the same.
SyrakuShaikh commented 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.

MaskRay commented 5 years ago
../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
SyrakuShaikh commented 5 years ago

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:)

MaskRay commented 5 years ago

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

SyrakuShaikh commented 5 years ago

Would you like to share your script for building the latest llvm+clang? Thanks:)

MaskRay commented 5 years ago

@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}