-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Reland [MS][clang] Add support for vector deleting destructors #170337
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
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3dc8666
Revert "Revert "Reland [MS][clang] Add support for vector deleting de…
Fznamznon 08a90c6
Fix issue with /Zc:dllexportInlines-
Fznamznon fcc9e19
Merge branch 'main' into its-reland-time
Fznamznon dfd63c0
Frame MarkFunctionReferenced calls with null checks
Fznamznon d615cb8
Add a trap
Fznamznon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
clang/test/CodeGenCXX/microsoft-vector-deleting-dtors2.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // RUN: %clang_cc1 -emit-llvm -fms-extensions -fms-compatibility -fno-dllexport-inlines %s -triple=x86_64-pc-windows-msvc -o - | FileCheck --check-prefixes=X64,CHECK %s | ||
| // RUN: %clang_cc1 -emit-llvm -fms-extensions -fms-compatibility -fno-dllexport-inlines %s -triple=i386-pc-windows-msvc -o - | FileCheck --check-prefixes=X86,CHECK %s | ||
|
|
||
| // Check that vector deleting destructor does not reference undefined symbols. | ||
|
|
||
| void operator delete(void*, size_t) {} | ||
| void operator delete[](void*, size_t) {} | ||
|
|
||
| template <typename T> struct RefCounted { | ||
| void operator delete[](void *p) { } | ||
| }; | ||
|
|
||
| struct __declspec(dllexport) DrawingBuffer : public RefCounted<DrawingBuffer> { | ||
| DrawingBuffer(); | ||
| virtual ~DrawingBuffer(); | ||
| }; | ||
|
|
||
| DrawingBuffer::DrawingBuffer() {} | ||
| DrawingBuffer::~DrawingBuffer() {} | ||
|
|
||
| struct NoExport : public RefCounted<NoExport> { | ||
| NoExport(); | ||
| virtual ~NoExport(); | ||
| }; | ||
|
|
||
| NoExport::NoExport() {} | ||
| NoExport::~NoExport() {} | ||
|
|
||
| // X64: define dso_local void @"??3@YAXPEAX_K@Z"(ptr noundef %0, i64 noundef %1) | ||
| // X64: define dso_local void @"??_V@YAXPEAX_K@Z"(ptr noundef %0, i64 noundef %1) | ||
| // X64: define dso_local dllexport void @"??1DrawingBuffer@@UEAA@XZ"(ptr noundef nonnull align 8 dereferenceable(8) %this) | ||
|
|
||
| // X64: define weak dso_local noundef ptr @"??_EDrawingBuffer@@UEAAPEAXI@Z" | ||
| // X64: call void @"??1DrawingBuffer@@UEAA@XZ"(ptr noundef nonnull align 8 dereferenceable(8) %arraydestroy.element) | ||
| // X64: call void @"??_V?$RefCounted@UDrawingBuffer@@@@SAXPEAX@Z"(ptr noundef %2) #2 | ||
| // X64: call void @"??_V@YAXPEAX_K@Z"(ptr noundef %2, i64 noundef 8) #3 | ||
| // X64: call void @"??1DrawingBuffer@@UEAA@XZ"(ptr noundef nonnull align 8 dereferenceable(8) %this1) | ||
| // X64: call void @"??3@YAXPEAX_K@Z"(ptr noundef %this1, i64 noundef 8) #3 | ||
|
|
||
| // X64: define linkonce_odr dso_local void @"??_V?$RefCounted@UDrawingBuffer@@@@SAXPEAX@Z"(ptr noundef %p) | ||
|
|
||
| // X86: define dso_local void @"??3@YAXPAXI@Z"(ptr noundef %0, i32 noundef %1) | ||
| // X86: define dso_local void @"??_V@YAXPAXI@Z"(ptr noundef %0, i32 noundef %1) | ||
|
|
||
| // X86: define weak dso_local x86_thiscallcc noundef ptr @"??_EDrawingBuffer@@UAEPAXI@Z" | ||
| // X86: call x86_thiscallcc void @"??1DrawingBuffer@@UAE@XZ"(ptr noundef nonnull align 4 dereferenceable(4) %arraydestroy.element) | ||
| // X86: call void @"??_V?$RefCounted@UDrawingBuffer@@@@SAXPAX@Z"(ptr noundef %2) | ||
| // X86: call void @"??_V@YAXPAXI@Z"(ptr noundef %2, i32 noundef 4) | ||
| // X86 call x86_thiscallcc void @"??1DrawingBuffer@@UAE@XZ"(ptr noundef nonnull align 4 dereferenceable(4) %this1) | ||
| // X86: call void @"??3@YAXPAXI@Z"(ptr noundef %this1, i32 noundef 4) | ||
|
|
||
| // X86: define linkonce_odr dso_local void @"??_V?$RefCounted@UDrawingBuffer@@@@SAXPAX@Z"(ptr noundef %p) | ||
|
|
||
| // X86: define linkonce_odr dso_local x86_thiscallcc noundef ptr @"??_GNoExport@@UAEPAXI@Z"(ptr noundef nonnull align 4 dereferenceable(4) %this, i32 noundef %should_call_delete) | ||
| // X64: define linkonce_odr dso_local noundef ptr @"??_GNoExport@@UEAAPEAXI@Z"(ptr noundef nonnull align 8 dereferenceable(8) %this, i32 noundef %should_call_delete) | ||
| // CHECK-NOT: define {{.*}}_V{{.*}}NoExport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.