[llvm] Supports viewing class member variables in lambda when using the vs debugger (PR #71564)
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 10 15:16:07 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`
----------------
ZequanWu wrote:
It's better to avoid hard coded indexes like `0x1003` etc and using [regex](https://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-string-substitution-blocks).
Consider using `[[FooIndex:0x[A-Z0-9]+]]`
https://github.com/llvm/llvm-project/pull/71564
More information about the llvm-commits
mailing list