[clang] [CIR] Add support for emitting predefined expressions (PR #161757)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 2 19:43:33 PDT 2025
================
@@ -2372,6 +2373,21 @@ mlir::Value CIRGenFunction::emitScalarConstant(
return builder.getConstant(getLoc(e->getSourceRange()), constant.getValue());
}
+LValue CIRGenFunction::emitPredefinedLValue(const PredefinedExpr *e) {
+ const StringLiteral *sl = e->getFunctionName();
+ assert(sl != nullptr && "No StringLiteral name in PredefinedExpr");
+ auto fn = cast<cir::FuncOp>(curFn);
+ StringRef fnName = fn.getName();
+ fnName.consume_front("\01");
+ StringRef nameItems[] = {PredefinedExpr::getIdentKindName(e->getIdentKind()),
----------------
erichkeane wrote:
can we just make this a std::array<StringRef,2> here? That way we can use the range-version of llvm::join and not have the magic 2 there (and yes, i know we'd have it HERE, but at least then the compiler would figure it out).
https://github.com/llvm/llvm-project/pull/161757
More information about the cfe-commits
mailing list