[PATCH] D43838: [CodeView] Initial support for emitting S_THUNK32 symbols for compiler-generated thunk routines

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 14:44:30 PST 2018


rnk added a comment.

Thanks! Can you add a clang IRGen test that checks the DISubprogram flags set for thunks?



================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:869
+
+  // Emit S_END
+  const unsigned RecordLengthForSymbolEnd = 2;
----------------
This throws away all the local variables and inlined call sites in the thunk. I guess that's good enough for -O0, and optimized debug info is best effort anyway, but it's worth a comment, either here or at the point where we return early for thunks.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:874
+  OS.AddComment("Record kind: S_END");
+  OS.EmitIntValue(unsigned(SymbolKind::S_END), 2);
+
----------------
I noticed that MSVC emits `S_PROC_ID_END`. Should we do that too?


================
Comment at: llvm/test/DebugInfo/COFF/thunk.ll:20
+;     b->MyMethod();
+;     c->MyMethod();
+;     return 0;
----------------
Can you add a member pointer thunk to this test? Add something like:
```
bool (A::*mp)() = &A::MyMethod;
```
The ??_9 function should be a thunk.


https://reviews.llvm.org/D43838





More information about the llvm-commits mailing list