-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support IAR ARM compiler? #476
Comments
ccls is a clang based tool. It reuses clangDriver, clangLex, clangParse, clangSema, etc. The predefined macros are provided by the driver. According to the target triple and some command line options, the compiler supplies a set of predefined macros.
% clang -target armv7-linux-gnueabi -E -dM -xc /dev/null | grep GNUC
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1
#define __GNUC__ 4
% clang -target armv7-linux-gnueabi -E -dM -xc /dev/null -fms-compatibility | grep GNUC
% clang -target armv7-linux-gnueabi -E -dM -xc /dev/null -U __GNUC__ | grep GNUC
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC_STDC_INLINE__ 1 You need to check what other macros your project detects and undefine them. An example
|
Thanks for your help, it works. |
@mkitby I wonder if you somehow managed to convert IAR .ewp files to CMake format automatically, or you just created the CMake by hand? |
I created CMake by hand |
I use CMake and IAR ARM compiler to compile my code for an ARM processor. The CMake generates compile_commands.json and ccls knows the complete command line. I want ccls to support the IAR ARM compiler and can jump to the IAR ARM compiler header files.
The C runtime and compiler header files are installed in ../Config/exec/arm/inc/c, and __ICCARM__ is an internal preprocessor defined by the IAR ARM compiler.
Here is my .ccls file,
Now the problem is why macro __GNUC__ is defined with -target arm? If I remove -target arm in .ccls, then macro _MSC_VER will be defined. Is there a -target support the IAR ARM compiler? If no, how to set the configuration to not define any compiler macro like _MSC_VER and __GNUC__
The text was updated successfully, but these errors were encountered: