https://github.com/petergrind3 created 
https://github.com/llvm/llvm-project/pull/150575

Sometimes between April 2023 and today the option disappeared. I wasn't able to 
trace when it went away through the different refactoring.


>From 20745528ddd459d2f77b677e3f22118d810e8741 Mon Sep 17 00:00:00 2001
From: petergrind3 <petergri...@gmail.com>
Date: Fri, 25 Jul 2025 04:56:25 +0000
Subject: [PATCH] [lanai] Add back the ability to set the memory model with
 --mcmodel.

Sometimes between April 2023 and today the option disappeared. I wasn't able to 
trace when it went away through the different refactoring.
---
 clang/lib/Driver/ToolChains/CommonArgs.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp 
b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 826e2ea7eb06d..9cac8b1517ea1 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -3055,6 +3055,8 @@ void tools::addMCModel(const Driver &D, const 
llvm::opt::ArgList &Args,
       else if (CM == "medany")
         CM = "large";
       Ok = CM == "small" || CM == "medium" || CM == "large";
+    } else if (Triple.getArch() == llvm::Triple::lanai) {
+      Ok = llvm::is_contained({"small", "medium", "large"}, CM);
     }
     if (Ok) {
       CmdArgs.push_back(Args.MakeArgString("-mcmodel=" + CM));

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to