[DebugInfo] Fortran module DebugInfo support in LLVM

This patch extends DIModule Debug metadata in LLVM to support
Fortran modules. DIModule is extended to contain File and Line
fields, these fields will be used by Flang FE to create debug
information necessary for representing Fortran modules at IR level.

Furthermore DW_TAG_module is also extended to contain these fields.
If these fields are missing, debuggers like GDB won't be able to
show Fortran modules information correctly.

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D79484
This commit is contained in:
Sourabh Singh Tomar
2020-05-08 11:31:41 +05:30
parent 9d26ea44f0
commit 99bc9bdea6
17 changed files with 223 additions and 79 deletions

View File

@@ -1809,6 +1809,7 @@ void ModuleBitcodeWriter::writeDIModule(const DIModule *N,
Record.push_back(N->isDistinct());
for (auto &I : N->operands())
Record.push_back(VE.getMetadataOrNullID(I));
Record.push_back(N->getLineNo());
Stream.EmitRecord(bitc::METADATA_MODULE, Record, Abbrev);
Record.clear();