From ed6a129534dd018d21c91542aac61b4b835d6aa8 Mon Sep 17 00:00:00 2001 From: ShashwathiNavada Date: Wed, 29 Jan 2025 09:23:35 -0600 Subject: [PATCH] Adding diagnostics for unsupported option --- clang/lib/Frontend/CompilerInvocation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 8411217be8c8a..3a743c324c90b 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1897,6 +1897,15 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, Opts.setInlining(CodeGenOptions::NormalInlining); } +// -mcmodel option. +if (const llvm::opt::Arg *A = Args.getLastArg(clang::driver::options::OPT_mcmodel_EQ)) +{ + llvm::StringRef modelName = A->getValue(); + if(modelName=="tiny" && !T.isARM()) + Diags.Report(diag::err_drv_unsupported_option_argument_for_target) + << A->getSpelling() <