[clang] [llvm] [ARM] Adding diagnostics for mcmodel=tiny when used in invalid targets (PR #125643)

via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 28 10:26:08 PDT 2025


================
@@ -1755,6 +1755,18 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {
         << TC.getTriple().str();
   }
 
+  // Throw diagnosis if mcmodel=tiny option is passed for targets other than ARM
+  // or AArch64.
+  if (Arg *A = UArgs->getLastArg(options::OPT_mcmodel_EQ)) {
----------------
ShashwathiNavada wrote:

@MaskRay Thank you for your response!
I noticed that in the function you mentioned, there’s a check like this:

```
else if (Triple.getArch() == llvm::Triple::x86_64) {
    Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"}, CM);
}
```
I found that removing the tiny option here gives the desired result.
Would you mind confirming if this approach looks good before I push the changes?

https://github.com/llvm/llvm-project/pull/125643


More information about the cfe-commits mailing list