[DebugInfo] Fortran module DebugInfo support in LLVM
authorSourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Fri, 8 May 2020 06:01:41 +0000 (11:31 +0530)
committerSourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Wed, 13 May 2020 07:22:30 +0000 (12:52 +0530)
commite59744fd9b4298c0527163748510a482a942eb54
tree5451a474e95a213a3bc2d2f3ddea10ba75fe6dd1
parenteef95f2746c3347b8dad19091ffb82a88d73acd3
[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
17 files changed:
llvm/include/llvm/IR/DIBuilder.h
llvm/include/llvm/IR/DebugInfoMetadata.h
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/Bitcode/Reader/MetadataLoader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
llvm/lib/IR/AsmWriter.cpp
llvm/lib/IR/DIBuilder.cpp
llvm/lib/IR/DebugInfoMetadata.cpp
llvm/lib/IR/LLVMContextImpl.h
llvm/test/Assembler/dimodule.ll
llvm/test/Bitcode/DIModule-clang-module.ll [new file with mode: 0644]
llvm/test/Bitcode/DIModule-clang-module.ll.bc [new file with mode: 0644]
llvm/test/Bitcode/DIModule-fortran-module.ll [new file with mode: 0644]
llvm/test/Bitcode/DIModule-fortran-module.ll.bc [new file with mode: 0644]
llvm/test/DebugInfo/X86/Fortran-DIModule.ll [new file with mode: 0644]
llvm/unittests/IR/MetadataTest.cpp