OSDN Git Service

[DebugInfo] Upgrade DISubrange to support Fortran dynamic arrays
authorAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Thu, 28 May 2020 08:01:22 +0000 (13:31 +0530)
committerSourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
Thu, 28 May 2020 08:16:41 +0000 (13:46 +0530)
commitd20bf5a7258d4b6a7f017a81b125275dac1aa166
tree6930971b046adf42a04c671475f9add1a209d67e
parent213c6cdf2e7a30d722cee4cd66b7d48fc396d44b
[DebugInfo] Upgrade DISubrange to support Fortran dynamic arrays

This patch upgrades DISubrange to support fortran requirements.

Summary:
Below are the updates/addition of fields.
lowerBound - Now accepts signed integer or DIVariable or DIExpression,
earlier it accepted only signed integer.
upperBound - This field is now added and accepts signed interger or
DIVariable or DIExpression.
stride - This field is now added and accepts signed interger or
DIVariable or DIExpression.
This is required to describe bounds of array which are known at runtime.

Testing:
unit test cases added (hand-written)
check clang
check llvm
check debug-info

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D80197
34 files changed:
clang/lib/CodeGen/CGDebugInfo.cpp
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/CodeViewDebug.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.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/lib/IR/Verifier.cpp
llvm/test/Assembler/debug-info.ll
llvm/test/Assembler/disubrange-empty-array.ll
llvm/test/Assembler/invalid-disubrange-count-missing.ll
llvm/test/Bindings/llvm-c/debug_info.ll
llvm/test/Bitcode/fortranSubrange.ll [new file with mode: 0644]
llvm/test/Bitcode/fortranSubrangeBackward.ll [new file with mode: 0644]
llvm/test/Bitcode/fortranSubrangeBackward.ll.bc [new file with mode: 0644]
llvm/test/DebugInfo/X86/default-subrange-array.ll
llvm/test/DebugInfo/X86/nondefault-subrange-array.ll
llvm/test/DebugInfo/cDefaultLower.ll [new file with mode: 0644]
llvm/test/DebugInfo/fortranDefaultLower.ll [new file with mode: 0644]
llvm/test/DebugInfo/fortranSubrangeExpr.ll [new file with mode: 0644]
llvm/test/DebugInfo/fortranSubrangeInt.ll [new file with mode: 0644]
llvm/test/DebugInfo/fortranSubrangeVar.ll [new file with mode: 0644]
llvm/test/Verifier/disubrange-count-upperBound.ll [new file with mode: 0644]
llvm/test/Verifier/disubrange-missing-upperBound.ll [new file with mode: 0644]
llvm/test/Verifier/invalid-disubrange-lowerBound.ll [new file with mode: 0644]
llvm/test/Verifier/invalid-disubrange-stride.ll [new file with mode: 0644]
llvm/test/Verifier/invalid-disubrange-upperBound.ll [new file with mode: 0644]
llvm/unittests/IR/MetadataTest.cpp