Skip to content

Commit a896c41

Browse files
authored
[CIR] Add support for delegating ctor with VTT (#1890)
This implements getting the VTT argument for a delegating constructor and enables the corresponding test in delegating-ctor.cpp.
1 parent 29b2a4e commit a896c41

File tree

2 files changed

+280
-39
lines changed

2 files changed

+280
-39
lines changed

clang/lib/CIR/CodeGen/CIRGenClass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,8 @@ mlir::Value CIRGenFunction::GetVTTParameter(GlobalDecl GD, bool ForVirtualBase,
15361536
uint64_t SubVTTIndex;
15371537

15381538
if (Delegating) {
1539-
llvm_unreachable("NYI");
1539+
// If this is a delegating constructor call, just load the VTT.
1540+
return LoadCXXVTT();
15401541
} else if (RD == Base) {
15411542
// If the record matches the base, this is the complete ctor/dtor
15421543
// variant calling the base variant in a class with virtual bases.

0 commit comments

Comments
 (0)