Re: Pull request 853 in include-what-you-use: Support for Objective-C

2 views
Skip to first unread message

notifi...@include-what-you-use.org

unread,
Aug 2, 2021, 11:00:52 AM8/2/21
to include-wh...@googlegroups.com
Comment #6 on pull request 853 by buptwsg: Support for Objective-C
https://github.com/include-what-you-use/include-what-you-use/pull/853

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!

notifi...@include-what-you-use.org

unread,
Aug 2, 2021, 11:34:00 AM8/2/21
to include-wh...@googlegroups.com
Comment #7 on pull request 853 by buptwsg: Support for Objective-C

notifi...@include-what-you-use.org

unread,
Aug 2, 2021, 11:34:08 AM8/2/21
to include-wh...@googlegroups.com
Comment #6 on pull request 853 by buptwsg: Support for Objective-C
https://github.com/include-what-you-use/include-what-you-use/pull/853

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

notifi...@include-what-you-use.org

unread,
Aug 3, 2021, 12:34:27 AM8/3/21
to include-wh...@googlegroups.com
Comment #5 on pull request 853 by buptwsg: Support for Objective-C
https://github.com/include-what-you-use/include-what-you-use/pull/853

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!

notifi...@include-what-you-use.org

unread,
Aug 4, 2021, 4:35:12 AM8/4/21
to include-wh...@googlegroups.com
Comment #6 on pull request 853 by kimgr: Support for Objective-C
https://github.com/include-what-you-use/include-what-you-use/pull/853

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

notifi...@include-what-you-use.org

unread,
Aug 6, 2021, 7:14:54 AM8/6/21
to include-wh...@googlegroups.com
Comment #7 on pull request 853 by storoj: Support for Objective-C
https://github.com/include-what-you-use/include-what-you-use/pull/853

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

Reply all
Reply to author
Forward
0 new messages