================
@@ -0,0 +1,40 @@
+// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm 
-debug-info-kind=limited -dwarf-version=5 -O0 -disable-llvm-passes %s -o - \
+// RUN:        | FileCheck %s
+
+// When compiling this with limited debug info, a replaceable forward 
declaration DICompositeType
+// for "n" is created in the scope of base object constructor (C2) of class l, 
and it's not immediately
+// replaced with a distinct node (the type is not "completed").
+// Later, it gets replaced with distinct definition DICompositeType, which is 
created in the scope of
+// complete object constructor (C1).
+//
+// In contrast to that, in standalone debug info mode, the complete definition 
DICompositeType
+// for "n" is created sooner, right in the context of C2.
+//
+// Check that DIBuilder processes the limited debug info case correctly, and 
doesn't add the same
+// local type to retainedNodes fields of both DISubprograms (C1 and C2).
+
+// FIXME: Should we ensure that DICompositeType is emitted in the same scope 
in both limited and
+// standalone modes?
----------------
dzhidzhoev wrote:

I've noticed this quirk when building clang on clang in limited debug info mode 
on my own (and got a crash bc of DIBuilder attaching a type to two subprograms).
I haven't received feedback from consumers about the mismatch in where (in 
which constructor version) local types are emitted.
I will remove this FIXME for now, check a bit later how this affects debugging 
experience, and create an issue for that if there is something (not sure how 
much time I'll have this week as I'm out of office).

https://github.com/llvm/llvm-project/pull/180294
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to