[PATCH] D113142: [CodeView] Properly handle a DISubprogram in getScopeIndex.

Chih-Ping Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 13:53:40 PDT 2021


cchen15 created this revision.
cchen15 added a reviewer: rnk.
Herald added subscribers: arphaman, hiraditya.
cchen15 requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: llvm-commits, sstefan1.
Herald added a project: LLVM.

There's no need to handle DISubprogram in getScopeIndex for C/C++ as a function can't be nested in another function. That's not the case for Fortran-- a routine can be nested in another routine through the 'contains' keyword. This patch enables the emission of proper debug info for the containing function.

Please note that before this patch, getScopeIndex would emit a LF_STRING_ID when given a DISubprogram. That's not only incorrect, but would also cause link-time error with the linker from a more recent version (Aug. 20219) of VS2019.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113142

Files:
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/test/DebugInfo/COFF/fortran-contained-proc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113142.384575.patch
Type: text/x-patch
Size: 7138 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/ab6ec1dd/attachment.bin>


More information about the llvm-commits mailing list