Skip to content

[SYCL] Force Clang to emit complete object constructor for SYCLMemObjT #1652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2020

Conversation

alexbatashev
Copy link
Contributor

GCC produces two symbols for one of SYCLMemObjT's constructors:

_ZN2cl4sycl6detail11SYCLMemObjTC1EP7_cl_memRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteISA_E
_ZN2cl4sycl6detail11SYCLMemObjTC2EP7_cl_memRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteISA_E

Those are complete object constructor and base object constructor. The
difference is that complete object constructor initializes vtable, while
base object constructor accepts it from a derived class.

On the other hand, Clang is smart enough to see that SYCLMemObjT is a
pure virtual class, and its complete object constructor can be dropped.

This patch adds dumb implementation for missing member functions to SYCLMemObjT
to force Clang behave the same way GCC does.

GCC produces two symbols for one of SYCLMemObjT's constructors:
```
_ZN2cl4sycl6detail11SYCLMemObjTC1EP7_cl_memRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteISA_E
_ZN2cl4sycl6detail11SYCLMemObjTC2EP7_cl_memRKNS0_7contextEmNS0_5eventESt10unique_ptrINS1_19SYCLMemObjAllocatorESt14default_deleteISA_E
```

Those are complete object constructor and base object constructor. The
difference is that complete object constructor initializes vtable, while
base object constructor accepts it from a derived class.

On the other hand, Clang is smart enough to see that SYCLMemObjT is a
pure virtual class, and its complete object constructor can be dropped.

This patch adds dumb implementation for missing member functions to SYCLMemObjT
to force Clang behave the same way GCC does.
@alexbatashev alexbatashev requested a review from romanovvlad May 7, 2020 12:41
@alexbatashev alexbatashev requested a review from a team as a code owner May 7, 2020 12:41
Signed-off-by: Ivan Karachun <[email protected]>
@KarachunIvan KarachunIvan requested a review from romanovvlad May 12, 2020 09:55
@bader bader merged commit 44954af into intel:sycl May 12, 2020
@alexbatashev alexbatashev deleted the private/abatashe/abi_clang_fix branch July 28, 2021 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants