[clang] [lanai] Add back the ability to set the memory model with --mcmodel. (PR #150575)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 24 22:27:45 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (petergrind3)

<details>
<summary>Changes</summary>

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


---
Full diff: https://github.com/llvm/llvm-project/pull/150575.diff


1 Files Affected:

- (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+2) 


``````````diff
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));

``````````

</details>


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


More information about the cfe-commits mailing list