================ @@ -495,6 +498,23 @@ void CIRGenModule::setNonAliasAttributes(GlobalDecl gd, mlir::Operation *op) { assert(!cir::MissingFeatures::setTargetAttributes()); } +cir::SourceLanguage CIRGenModule::getCIRSourceLanguage() const { + using ClangStd = clang::LangStandard; + using CIRLang = cir::SourceLanguage; + auto opts = getLangOpts(); + + if (opts.CPlusPlus) + return CIRLang::CXX; + if (opts.C99 || opts.C11 || opts.C17 || opts.C23 || opts.C2y || + opts.LangStd == ClangStd::lang_c89 || + opts.LangStd == ClangStd::lang_gnu89) + return CIRLang::C; + + // TODO(cir): support remaining source languages. + assert(!cir::MissingFeatures::sourceLanguageCases()); + errorNYI("CIR does not yet support the given source language"); ---------------- andykaylor wrote:
This needs to return a value? @bcardosolopes Should we adda CIRLang::Other? https://github.com/llvm/llvm-project/pull/152511 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits