[PATCH] D117423: [AVR][clang] Reject non assembly source files for the avr1 family

Ben Shi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 24 19:33:59 PST 2022


benshi001 marked an inline comment as done.
benshi001 added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5149
+  // Devices in the avr-1 family only support assembly programming.
+  if (TC.getArch() == llvm::Triple::avr) {
+    auto const &AVRTC = static_cast<const toolchains::AVRToolChain &>(TC);
----------------
MaskRay wrote:
> Try moving the check from the generic file to the toolchain-specific file.
I have created another patch to do this check in avr toolchain specific files.

https://reviews.llvm.org/D118095

which is much more complex than current solution.

But I do see there are other target specific checks in the common `Clang::ConstructJob`, such as

https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L5153

https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L5019

https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Clang.cpp#L5257


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117423/new/

https://reviews.llvm.org/D117423



More information about the cfe-commits mailing list