hi @storoj ,
When I build your forked iwyu, I got compile errors:
[ 91%] Building CXX object CMakeFiles/include-what-you-use.dir/iwyu.cc.o
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:1985:19: error: no member named 'CK_FixedPointToFloating' in namespace 'clang'; did you mean
'CK_FixedPointToBoolean'?
case clang::CK_FixedPointToFloating:
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
CK_FixedPointToBoolean
/Users/shuguang/DevEnvironment/llvm-project/clang/include/clang/AST/OperationKinds.def:218:1: note: 'CK_FixedPointToBoolean' declared here
CAST_OPERATION(FixedPointToBoolean)
^
/Users/shuguang/DevEnvironment/llvm-project/clang/include/clang/AST/OperationKinds.h:21:30: note: expanded from macro 'CAST_OPERATION'
#define CAST_OPERATION(Name) CK_##Name,
^
<scratch space>:113:1: note: expanded from here
CK_FixedPointToBoolean
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:1994:19: error: no member named 'CK_FloatingToFixedPoint' in namespace 'clang'; did you mean
'CK_IntegralToFixedPoint'?
case clang::CK_FloatingToFixedPoint:
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
CK_IntegralToFixedPoint
/Users/shuguang/DevEnvironment/llvm-project/clang/include/clang/AST/OperationKinds.def:214:1: note: 'CK_IntegralToFixedPoint' declared here
CAST_OPERATION(IntegralToFixedPoint)
^
/Users/shuguang/DevEnvironment/llvm-project/clang/include/clang/AST/OperationKinds.h:21:30: note: expanded from macro 'CAST_OPERATION'
#define CAST_OPERATION(Name) CK_##Name,
^
<scratch space>:112:1: note: expanded from here
CK_IntegralToFixedPoint
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:2007:19: error: no member named 'CK_MatrixCast' in namespace 'clang'; did you mean
'CK_BitCast'?
case clang::CK_MatrixCast:
~~~~~~~^~~~~~~~~~~~~
CK_BitCast
/Users/shuguang/DevEnvironment/llvm-project/clang/include/clang/AST/OperationKinds.def:61:1: note: 'CK_BitCast' declared here
CAST_OPERATION(BitCast)
^
/Users/shuguang/DevEnvironment/llvm-project/clang/include/clang/AST/OperationKinds.h:21:30: note: expanded from macro 'CAST_OPERATION'
#define CAST_OPERATION(Name) CK_##Name,
^
<scratch space>:82:1: note: expanded from here
CK_BitCast
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:2030:12: error: duplicate case value 'CK_BitCast'
case clang::CK_BitCast: // used for reinterpret_cast
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:2007:12: note: previous case defined here
case clang::CK_MatrixCast:
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:2004:12: error: duplicate case value 'CK_IntegralToFixedPoint'
case clang::CK_IntegralToFixedPoint:
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:1994:12: note: previous case defined here
case clang::CK_FloatingToFixedPoint:
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:1985:12: error: duplicate case value 'CK_FixedPointToBoolean'
case clang::CK_FixedPointToFloating:
^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:1984:12: note: previous case defined here
case clang::CK_FixedPointToBoolean:
^
6 errors generated.
make[2]: *** [CMakeFiles/include-what-you-use.dir/iwyu.cc.o] Error 1
make[1]: *** [CMakeFiles/include-what-you-use.dir/all] Error 2
make: *** [all] Error 2
I have a local llvm build with release/10.x branch, and iwyu is on branch objc.
Please help, thanks!
@storoj Thanks for your reply. I had a look at your forked repository: https://github.com/storoj/include-what-you-use/tree/objc, it seems that you fork the original repository after clang_10 branch. If I build IWYU, I should use clang_10, is it right?
Thanks.
hi @storoj ,
When I compile your forked iwyu, I meet compiler errors:
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:2662:54: error: no member named 'getUsingDecl' in 'clang::UsingShadowDecl'
make_pair(shadow->getTargetDecl(), shadow->getUsingDecl()));
~~~~~~ ^
/Users/shuguang/DevEnvironment/iwyu/include-what-you-use/iwyu.cc:2682:22: error: no member named 'getUsingDecl' in 'clang::UsingShadowDecl'
return shadow->getUsingDecl();
~~~~~~ ^
2 errors generated.
make[2]: *** [CMakeFiles/include-what-you-use.dir/iwyu.cc.o] Error 1
make[1]: *** [CMakeFiles/include-what-you-use.dir/all] Error 2
My environment:
llvm: branch release/13.x
iwyu: branch objc
Please help, thanks!
@buptwsg In general, you want to make sure you build IWYU with a compatible Clang. For @storoj's branch, I think you need to do a little detective work:
* `git checkout objc`
* `git branch --all --contains HEAD`
* From there, find the newest `clang_*` branch. That version number should be the LLVM version you need to install.
* The configure with `cmake` and provide the specific `-DCMAKE_PREFIX_PATH=...llvm/install/path/for/version`
I haven't been involved in the ObjC work, so I don't know how big the diff is against IWYU `master`, but you could also try rebasing on `master`, and then target LLVM/Clang mainline.
@kimgr @buptwsg hi guys, sorry I missed the topic. I did an eye laser surgery and I can't quite see well, especially phone/laptop screens :) I will do my best to help whenever I recover.