<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143787>143787</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[CIR] Upstream support for virtual functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
ClangIR
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
andykaylor
</td>
</tr>
</table>
<pre>
### Overview
Upstream support for declaring, calling, and emitting virtual functions in CIR.
This is probably going to involve a lot of changes, including the introduction of vtables. The changes should be upstreamed in the smallest pieces possible and growing the support incrementally.
### Suggested minimal test case
```
class C {
int a; // Necessary until we have better handling for zero-member classes
virtual void vf();
}
int f() {
C c;
}
```
### Existing incubator tests
clang/test/CIR/CodeGen/vtable-emission.cpp
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU1-PuzYQ_DTmZZUIDATywEMu11T30krX6wcwZgPbGht5ba7pp69Mkl5P_UkWf8Tu7MwOo5hptIidqF9E_ZqpGCbnO2WH25_qZpzPejfcOiHL-4FfV_Qr4afIT78vHDyqGTgui_MBrs7DgNooT3YU8gxaGfN4VHYAnCkEsiOs5ENUBq7R6kDOMpCF89v7XuQnkZ8-JmIghsW7XvXmBqNLXcEB2dWZFUGBcQHcFfSk7IicJpDVJg5b4YRANng3xA0-Fa5B9QZ5Dx8TPruAJxfNAD1CfGjBIVFJADwrY5ADLIQaGRbHTL3BTcno3edz0lM9We1xRhuUMbeHkq-9_RbHETngADNZmpWBkMC1Ykx1h_xx8pM2ihnOIJoXkZ8gKQElyhcQ8iLkBX5JdFj5G0QbyMAnwqRWhB5DQA-TskNa-ubG3-jdbsa5Rw8bLvKG-TRgdTTAehWyFfIoyjRQNK937mnu48u_XM6gv1X9h_Y3tT_9Rbw5TVbHXgXnN7l8l5f-iEt6F_JyfntPVzfgz2iFvNx92uFMzOTsXi9LNnTlcCyPKsOuaKrjoWlKKbOpK-tClW3d9E1THtvq2uqiLbCvy4PKq6Y9ZNTJXNb5oShkIdtK7uvq0F_roimPjSxV1Ygqx1mR2Ruzznvnx4yYI3ZFVTZtkxnVo-EtG1KeE_HEVqag-C617Po4sqhyQxz4CyRQMFukkrr6FX6YlP-FIIvedFMIC4vydDd7pDDFfq_dLOQlwT9uu8W7P1CnBW6EWcjLg_PayX8CAAD__0kFPY8">