Page MenuHomePhabricator

[clang][AVR] add more builtin macros
AbandonedPublic

Authored by benshi001 on Apr 11 2022, 9:14 PM.

Details

Diff Detail

Event Timeline

benshi001 created this revision.Apr 11 2022, 9:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 9:14 PM
benshi001 requested review of this revision.Apr 11 2022, 9:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2022, 9:14 PM

avr-gcc -E -dM -xc /dev/null -dM | grep __avr has no result, so I am not sure this is correct.

avr-gcc -E -dM -xc /dev/null -dM | grep __avr has no result, so I am not sure this is correct.

The reason I added these little case macros, is that I find other backend targets have, as shown in the compiler-rt's CMakefile, https://github.com/llvm/llvm-project/blob/main/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L155

I think we need not strictly follow avr-gcc's way, my final goal is making clang+llvm+compiler-rt+lld fully functional and can replace avr-gcc toolchain.

I expect clang+llvm+compiler-rt+lld to be fully functioning against the Arduino boards. (https://www.arduino.cc/).

MaskRay requested changes to this revision.Apr 11 2022, 10:51 PM

avr-gcc -E -dM -xc /dev/null -dM | grep __avr has no result, so I am not sure this is correct.

The reason I added these little case macros, is that I find other backend targets have, as shown in the compiler-rt's CMakefile, https://github.com/llvm/llvm-project/blob/main/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L155

I think we need not strictly follow avr-gcc's way, my final goal is making clang+llvm+compiler-rt+lld fully functional and can replace avr-gcc toolchain.

I expect clang+llvm+compiler-rt+lld to be fully functioning against the Arduino boards. (https://www.arduino.cc/).

Err, this is not sufficient justification to introduce new preprocessor macros. Changing the predefined macro set to make an in-tree cmake function happy. I am unsure this is the right thing.
If the cmake function isn't happy with a lowercase macro, can't you fix it?

This revision now requires changes to proceed.Apr 11 2022, 10:51 PM
benshi001 abandoned this revision.Apr 11 2022, 11:24 PM

avr-gcc -E -dM -xc /dev/null -dM | grep __avr has no result, so I am not sure this is correct.

The reason I added these little case macros, is that I find other backend targets have, as shown in the compiler-rt's CMakefile, https://github.com/llvm/llvm-project/blob/main/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L155

I think we need not strictly follow avr-gcc's way, my final goal is making clang+llvm+compiler-rt+lld fully functional and can replace avr-gcc toolchain.

I expect clang+llvm+compiler-rt+lld to be fully functioning against the Arduino boards. (https://www.arduino.cc/).

Err, this is not sufficient justification to introduce new preprocessor macros. Changing the predefined macro set to make an in-tree cmake function happy. I am unsure this is the right thing.
If the cmake function isn't happy with a lowercase macro, can't you fix it?

I am not sure if there are other concerns of using lower case macros in compiler-rt's CMake, and I will check that.