[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
This commit is contained in:
Chih-Ping Chen
2020-12-17 11:08:46 -05:00
parent 6c0d365003
commit c44b393235
14 changed files with 217 additions and 42 deletions
+1
View File
@@ -1868,6 +1868,7 @@ void ModuleBitcodeWriter::writeDIModule(const DIModule *N,
for (auto &I : N->operands())
Record.push_back(VE.getMetadataOrNullID(I));
Record.push_back(N->getLineNo());
Record.push_back(N->getIsDecl());
Stream.EmitRecord(bitc::METADATA_MODULE, Record, Abbrev);
Record.clear();