================
@@ -400,6 +400,14 @@ void AVRToolChain::AddClangSystemIncludeArgs(const ArgList 
&DriverArgs,
 void AVRToolChain::addClangTargetOptions(
     const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args,
     Action::OffloadKind DeviceOffloadKind) const {
+  // Reject C/C++ compilation for avr1 devices.
+  const Driver &D = getDriver();
+  std::string CPU = getCPUName(D, DriverArgs, getTriple());
+  std::optional<StringRef> FamilyName = GetMCUFamilyName(CPU);
+  if (CPU == "avr1" || (FamilyName && FamilyName->compare("avr1") == 0))
+    D.Diag(diag::err_drv_opt_unsupported_input_type) << "avr1"
+                                                     << "c/c++";
----------------
DavidSpickett wrote:

You could instead put `-mmcu=attiny11` as the value, then users know what part 
of the command triggered the issue, though they may not be aware that this 
whole category is the same. In practice I wonder if that would be more useful 
for most people.

Also what does gcc say in this situation?

https://github.com/llvm/llvm-project/pull/111798
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to