================ @@ -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); ---------------- Leporacanthicus wrote:
Yes, as do we. Just not in this piece of code, it happens when we're parsing arguments. We call this function twice, only checking in the first place. Approximately line 400 of flang/lib/Frontend/CompilerInvocation.cpp There are tests in flang/test/Driver/mcmodel.f90 for generating an error. https://github.com/llvm/llvm-project/pull/95411 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits