[DebugInfo] Support Fortran 'use <external module>' statement.
authorChih-Ping Chen <chih-ping.chen@intel.com>
Thu, 17 Dec 2020 16:08:46 +0000 (11:08 -0500)
committerChih-Ping Chen <chih-ping.chen@intel.com>
Fri, 18 Dec 2020 18:10:57 +0000 (13:10 -0500)
commit5f75dcf5719f8ba2819b73109888175cf92fe253
treef9c78d909914b2adb4586cb1de0b189b057afc0c
parent5e5ef5359742c3feb6f41058a356a28c7ab3ea6d
[DebugInfo] Support Fortran 'use <external module>' statement.

The main change is to add a 'IsDecl' field to DIModule so
that when IsDecl is set to true, the debug info entry generated
for the module would be marked as a declaration. That way, the debugger
would look up the definition of the module in the gloabl scope.

Please see the comments in llvm/test/DebugInfo/X86/dimodule.ll
for what the debug info entries would look like.

Differential Revision: https://reviews.llvm.org/D93462
14 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-fortran-external-module.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/dimodule.ll [new file with mode: 0644]
llvm/unittests/IR/MetadataTest.cpp