diff options
author | Chih-Ping Chen <chih-ping.chen@intel.com> | 2020-12-17 11:08:46 -0500 |
---|---|---|
committer | Chih-Ping Chen <chih-ping.chen@intel.com> | 2020-12-18 13:10:57 -0500 |
commit | 5f75dcf5719f8ba2819b73109888175cf92fe253 (patch) | |
tree | f9c78d909914b2adb4586cb1de0b189b057afc0c /llvm/lib/Bitcode/Reader/MetadataLoader.cpp | |
parent | 5e5ef5359742c3feb6f41058a356a28c7ab3ea6d (diff) | |
download | llvm-5f75dcf5719f8ba2819b73109888175cf92fe253.zip llvm-5f75dcf5719f8ba2819b73109888175cf92fe253.tar.gz llvm-5f75dcf5719f8ba2819b73109888175cf92fe253.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Bitcode/Reader/MetadataLoader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/MetadataLoader.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp index 3fc85b1..8cdda62 100644 --- a/llvm/lib/Bitcode/Reader/MetadataLoader.cpp +++ b/llvm/lib/Bitcode/Reader/MetadataLoader.cpp @@ -1565,19 +1565,20 @@ Error MetadataLoader::MetadataLoaderImpl::parseOneMetadata( } case bitc::METADATA_MODULE: { - if (Record.size() < 5 || Record.size() > 8) + if (Record.size() < 5 || Record.size() > 9) return error("Invalid record"); - unsigned Offset = Record.size() >= 7 ? 2 : 1; + unsigned Offset = Record.size() >= 8 ? 2 : 1; IsDistinct = Record[0]; MetadataList.assignValue( GET_OR_DISTINCT( DIModule, - (Context, Record.size() >= 7 ? getMDOrNull(Record[1]) : nullptr, + (Context, Record.size() >= 8 ? getMDOrNull(Record[1]) : nullptr, getMDOrNull(Record[0 + Offset]), getMDString(Record[1 + Offset]), getMDString(Record[2 + Offset]), getMDString(Record[3 + Offset]), getMDString(Record[4 + Offset]), - Record.size() <= 7 ? 0 : Record[7])), + Record.size() <= 7 ? 0 : Record[7], + Record.size() <= 8 ? false : Record[8])), NextMetadataNo); NextMetadataNo++; break; |