================ @@ -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:
The error is certainly the right category, but it's a shame you can't have it say "device family 'avr1'" (replace "device family" with whatever the correct term is). I looked around and I don't see a way to use an existing error but prepend to the text. Only other way is to make a whole new error type which seems a shame when this is so close. Not that big of a deal, but it would help new users I think. @Sirraide you helped me on diagnostics before, is it plausible to do that or is a new error type the only way? 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