Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Relanding r357928 with fixed debuginfo check.
[MS] Add metadata for __declspec(allocator) Original summary: Emit !heapallocsite in the metadata for calls to functions marked with __declspec(allocator). Eventually this will be emitted as S_HEAPALLOCSITE debug info in codeview. Differential Revision: https://reviews.llvm.org/D60237 llvm-svn: 358307
- Loading branch information
Showing
4 changed files
with
54 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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 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 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 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,27 @@ | ||
// RUN: %clang_cc1 -triple x86_64-windows-msvc -debug-info-kind=limited -gcodeview -fdeclspec -S -emit-llvm < %s | FileCheck %s | ||
|
||
struct Foo { | ||
int x; | ||
}; | ||
|
||
__declspec(allocator) void *alloc_void(); | ||
__declspec(allocator) struct Foo *alloc_foo(); | ||
|
||
void call_alloc_void() { | ||
struct Foo *p = (struct Foo*)alloc_void(); | ||
} | ||
|
||
void call_alloc_foo() { | ||
struct Foo *p = alloc_foo(); | ||
} | ||
|
||
// CHECK-LABEL: define {{.*}}void @call_alloc_void | ||
// CHECK: call i8* {{.*}}@alloc_void{{.*}} !heapallocsite [[DBG1:!.*]] | ||
|
||
// CHECK-LABEL: define {{.*}}void @call_alloc_foo | ||
// CHECK: call %struct.Foo* {{.*}}@alloc_foo{{.*}} !heapallocsite [[DBG2:!.*]] | ||
|
||
// CHECK: [[DBG1]] = !{} | ||
// CHECK: [[DBG2]] = distinct !DICompositeType(tag: DW_TAG_structure_type, | ||
// CHECK-SAME: name: "Foo" | ||
|