[llvm] Supports viewing class member variables in lambda when using the vs debugger (PR #71564)

via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 11 05:47:03 PST 2023


================
@@ -0,0 +1,245 @@
+; RUN: llc -filetype=obj %s -o %t.obj
+; RUN: llvm-pdbutil dump -symbols -types %t.obj | FileCheck %s
+
+; C++ source to regenerate:
+; $ cat t.cpp
+; class Foo {
+; public:
+;   void foo() {
+;     int aa = 4;
+;     int bb = 5;
+;     int cc = 6;
+;     auto f = [=] {
+;       int aaa = a + aa;
+;       int bbb = b + bb;
+;       int ccc = c + cc;
+;     };
+;     f();
+;   }
+; 
+; private:
+;   int a = 1;
+;   int b = 2;
+;   int c = 3;
+; };
+; 
+; int main() {
+;   Foo f;
+;   f.foo();
+; 
+;   return 0;
+; }
+; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
+
+; CHECK:                       Types (.debug$T)
+; CHECK-NEXT: ============================================================
+; CHECK:0x1003 | LF_CLASS [size = 36] `Foo`
----------------
GkvJwa wrote:

I use regular expressions to identify index, but type is still hard-coded

The type will remain consistent with this:
https://github.com/llvm/llvm-project/blob/edd690b02e16e991393bf7f67631196942369aed/llvm/test/DebugInfo/COFF/udts-complete.ll#L20-L30

https://github.com/llvm/llvm-project/pull/71564


More information about the llvm-commits mailing list