[flang-commits] [clang] [flang] [flang] Implement -mcmodel flag (PR #95411)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Jul 2 03:39:30 PDT 2024


================
@@ -21,4 +22,14 @@ CodeGenOptions::CodeGenOptions() {
 #include "flang/Frontend/CodeGenOptions.def"
 }
 
+std::optional<llvm::CodeModel::Model> getCodeModel(llvm::StringRef string) {
+  return llvm::StringSwitch<std::optional<llvm::CodeModel::Model>>(string)
+      .Case("tiny", llvm::CodeModel::Model::Tiny)
+      .Case("small", llvm::CodeModel::Model::Small)
+      .Case("kernel", llvm::CodeModel::Model::Kernel)
+      .Case("medium", llvm::CodeModel::Model::Medium)
+      .Case("large", llvm::CodeModel::Model::Large)
+      .Default(std::nullopt);
----------------
tblah wrote:

Does clang warn or error for an invalid code model?

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


More information about the flang-commits mailing list