[clang] [CIR][Dialect] Add SourceLangAttr (PR #152511)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 19 00:04:43 PDT 2025
================
@@ -495,6 +498,25 @@ 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 || opts.CPlusPlus11 || opts.CPlusPlus14 ||
+ opts.CPlusPlus17 || opts.CPlusPlus20 || opts.CPlusPlus23 ||
+ opts.CPlusPlus26)
+ return CIRLang::CXX;
----------------
seven-mile wrote:
Indeed, I'll give it a try in a later patch.
https://github.com/llvm/llvm-project/pull/152511
More information about the cfe-commits
mailing list