Details
Diff Detail
Event Timeline
- If '-S'/'-c' is specified, do not generate link warnings;
- If '-S'/'-c' is not specified, '-mmcu' is specified and there is valid GCC installation, do not generate link warnings;
- If '-S'/'-c' is not specified, and '-mmcu' is not specified, genereate link warnings;
- If '-S'/'-c' is not specified, and there is no valid GCC installation, genereate link warnings.
- If '-S'/'-c' is specified, do not generate link warnings;
- User should be clear that he does not want link, so there is no link warning.
- If '-S'/'-c' is not specified, '-mmcu' is specified and there is valid GCC installation, do not generate link warnings;
- This is the normal case, link should be succesful.
- If '-S'/'-c' is not specified, and '-mmcu' is not specified, genereate link warnings;
- Since no MCU is specified, we should warn the user that no device library is linked.
- If '-S'/'-c' is not specified, and there is no valid avr-GCC installation, genereate link warnings.
- Since there is no avr-ld installed, we should warn the user that there is no link happens. That may changes if we choose to use lld in the future.
clang/lib/Driver/ToolChains/AVR.cpp | ||
---|---|---|
375 | This is insufficient. -fsyntax-only, -E, etc should not need the diagnostic as well. |
I think it is excessive to add so many RUN lines. I do not understand much about AVR -mcpu. That said, I created D122553 for what I think should be done for the -c/-S/-fsyntax-only condition. More tests would just be excessive.
You may adjust the patch to do the rest cleanups/fixes.
I have made some changes based on your https://reviews.llvm.org/D122553, it seems you have reverted. I suggest you recommit, since I have fixed the failures of lacking avr-gcc.
I did not specify --sysroot so the new tests failed on systems without avr-gcc. Relanded.
I have made some changes based on your code:
- We should always warn if there is no mmcu specified, since its info (instruction set version) is used by the llvm backend.
- We need no warn no avr-gcc&avr-libc if -S/-c is specified, since the compiling stage need neither avr-gcc nor avr-libc.
Thanks for your way to avoid checking so many -c/-S/-fsyntax-only/... conditions.
clang/lib/Driver/ToolChains/AVR.cpp | ||
---|---|---|
476–477 | The two if can be combined. |
clang/lib/Driver/ToolChains/AVR.cpp | ||
---|---|---|
476–477 | I will do it when committing. |
clang/lib/Driver/ToolChains/AVR.cpp | ||
---|---|---|
476–477 | We should not merge the above two if, due to this check. So I will keep my orginal form when committing. |
clang/lib/Driver/ToolChains/AVR.cpp | ||
---|---|---|
476–477 | OK. If we decide that empty -mpu will report a warning, reporting an additional warn_drv_avr_stdlib_not_linked may or may not be necessary, but I'm happy to defer that decision to you. |
This is insufficient. -fsyntax-only, -E, etc should not need the diagnostic as well.
I know there may be test coverage gap but it is excessive to test all of -S -c -E ... that there is no diagnostic.