summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-05-05 23:23:53 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-05-05 23:23:53 +0000
commitef8a9518826b5b6b726eec66fd2fce6a3532ac66 (patch)
tree48fbf1a336caa4d475751f53550bbbc1dd46f386 /clang/test/CodeGenObjC
parentfc55cb6e1481980aa6dcfa8c72f79e461201085e (diff)
downloadbcm5719-llvm-ef8a9518826b5b6b726eec66fd2fce6a3532ac66.tar.gz
bcm5719-llvm-ef8a9518826b5b6b726eec66fd2fce6a3532ac66.zip
Build debug info for ObjC interface types at the end of the translation unit to ensure all ivars are included.
This takes a different approach than the completedType/requiresCompleteType work which relies on AST callbacks to upgrade the type declaration to a definition. Instead, just defer constructing the definition to the end of the translation unit. This works because the definition is never needed by other debug info (so far as I know), whereas the definition of a struct may be needed by other debug info before the end of the translation unit (such as emitting the definition of a member function which must refer to that member function's declaration). If we had a callback for whenever an IVar was added to an ObjC interface we could use that, and remove the need for the ObjCInterfaceCache, which might be nice. (also would need a callback for when it was more than just a declaration so we could get properties, etc). A side benefit is that we also don't need the CompletedTypeCache anymore. Just rely on the declaration-ness of a type to decide whether its definition is yet to be emitted. There's still the PR19562 memory leak, but this should hopefully make that a bit easier to approach. llvm-svn: 208015
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/debug-info-ivars-indirect.m19
1 files changed, 16 insertions, 3 deletions
diff --git a/clang/test/CodeGenObjC/debug-info-ivars-indirect.m b/clang/test/CodeGenObjC/debug-info-ivars-indirect.m
index 8d1ab92d766..f9593d24dea 100644
--- a/clang/test/CodeGenObjC/debug-info-ivars-indirect.m
+++ b/clang/test/CodeGenObjC/debug-info-ivars-indirect.m
@@ -3,6 +3,14 @@
// Make sure we generate debug symbols for an indirectly referenced
// extension to an interface.
+// This happens to be the order the members are emitted in... I'm assuming it's
+// not meaningful/important, so if something causes the order to change, feel
+// free to update the test to reflect the new order.
+// CHECK: ; [ DW_TAG_member ] [a]
+// CHECK: ; [ DW_TAG_member ] [d]
+// CHECK: ; [ DW_TAG_member ] [c]
+// CHECK: ; [ DW_TAG_member ] [b]
+
@interface I
{
@public int a;
@@ -29,7 +37,6 @@ void gorf (struct S* s) {
int _b = s->i->b;
}
-// CHECK: ; [ DW_TAG_member ] [b]
I *source();
@@ -39,8 +46,14 @@ I *source();
}
@end
-// CHECK: ; [ DW_TAG_member ] [c]
-
void use() {
int _c = source()->c;
}
+
+@interface I()
+{
+ @public int d;
+}
+@end
+
+I *x();
OpenPOWER on IntegriCloud