[clang] [CIR] Add emitBuiltinWithOneOverloadedType helper (PR #199518)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Tue May 26 10:59:39 PDT 2026
================
@@ -1625,6 +1625,25 @@ class CIRGenFunction : public CIRGenTypeCache {
void instantiateIndirectGotoBlock();
+ /// Emit a simple LLVM intrinsic that takes N scalar arguments and whose
+ /// return type matches the type of the first argument. The intrinsic name is
+ /// used verbatim; any overload mangling (e.g. `.f32`, `.p1`) must be baked
+ /// into \p Name by the caller.
+ template <uint32_t N>
+ [[maybe_unused]] RValue
+ emitBuiltinWithOneOverloadedType(const CallExpr *E, llvm::StringRef Name) {
----------------
andykaylor wrote:
```suggestion
emitBuiltinWithOneOverloadedType(const CallExpr *e, llvm::StringRef intrinName) {
```
Use CIR naming style, but also, because this function exists in both CIR and classic codegen, I think it's important to make it clear that the second parameter here is the intrinsic name, and not the value name (as it is in classic codegen).
https://github.com/llvm/llvm-project/pull/199518
More information about the cfe-commits
mailing list