[PATCH] D20900: [CodeView] Implement function-type indices
Amjad Aboud via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 2 09:05:37 PDT 2016
aaboud added a comment.
Few comments below.
================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:484
@@ -497,2 +483,3 @@
OS.AddComment("Function type index");
- OS.EmitIntValue(0, 4);
+ if (const DISubprogram *Subprogram = GV->getSubprogram())
+ OS.EmitIntValue(getTypeIndex(Subprogram->getType()).getIndex(), 4);
----------------
1. You may use "auto *SP" (like in line 443) instead of "const DISubprogram *".
2. Can you explain why we might emit debug info for functions that have no DISubprogram attached to it?
================
Comment at: lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:485
@@ +484,3 @@
+ if (const DISubprogram *Subprogram = GV->getSubprogram())
+ OS.EmitIntValue(getTypeIndex(Subprogram->getType()).getIndex(), 4);
+ else
----------------
I thought we wanted to have the index of FuncIdRecord, not the index of ProcedureRecord, right?
Check line 128.
http://reviews.llvm.org/D20900
More information about the llvm-commits
mailing list