[clang] [CIR] Upstream support for emitting constructors (PR #143639)
Andy Kaylor via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 11 11:32:52 PDT 2025
================
@@ -21,6 +21,88 @@
using namespace clang;
using namespace clang::CIRGen;
+/// Checks whether the given constructor is a valid subject for the
+/// complete-to-base constructor delgation optimization, i.e. emitting the
+/// complete constructor as a simple call to the base constructor.
----------------
andykaylor wrote:
Update: I was misunderstanding what `isDelegatingConstructor()` constructor meant. It's not the relevant case here. This function is only called for the C1 constructor (ctorType == Ctor_Complete) and it returns `true` for the initial test case here, causing us to emit the constructor as a call to the C2 constructor.
When I add a variadic constructor (which I will in my next update to this PR), this function returns `false` and we emit the C1 constructor (but not the C2 constructor).
https://github.com/llvm/llvm-project/pull/143639
More information about the cfe-commits
mailing list