[PATCH] D60237: [MS] Add metadata for __declspec(allocator)
Reid Kleckner via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 5 16:05:17 PDT 2019
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm, with some suggestions to improve the test
================
Comment at: clang/test/CodeGen/debug-info-codeview-heapallocsite.c:16-19
+struct Foo foo_buf[1024];
+__declspec(allocator) struct Foo *alloc_foo() {
+ return &foo_buf[0];
+}
----------------
Personally, I think it's nicer to leave the allocator undefined, because then clang doesn't generate IR for it, and FileCheck doesn't have to scan through it. When these tests fail, humans have to generate the IR, read it, and try to understand it, and the less there is, the easier it is to understand.
================
Comment at: clang/test/CodeGen/debug-info-codeview-heapallocsite.c:28
+
+// CHECK-LABEL: define {{.*}}%struct.Foo* @alloc_foo
+// CHECK: call %struct.Foo* @alloc_foo(){{.*}} !heapallocsite [[DBG2:!.*]]
----------------
I think you want to look for `call_alloc_foo` in this CHECK.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60237/new/
https://reviews.llvm.org/D60237
More information about the cfe-commits
mailing list