diff options
author | Alok Kumar Sharma <AlokKumar.Sharma@amd.com> | 2020-05-28 13:31:22 +0530 |
---|---|---|
committer | Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com> | 2020-05-28 13:46:41 +0530 |
commit | d20bf5a7258d4b6a7f017a81b125275dac1aa166 (patch) | |
tree | 6930971b046adf42a04c671475f9add1a209d67e /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 213c6cdf2e7a30d722cee4cd66b7d48fc396d44b (diff) | |
download | llvm-d20bf5a7258d4b6a7f017a81b125275dac1aa166.zip llvm-d20bf5a7258d4b6a7f017a81b125275dac1aa166.tar.gz llvm-d20bf5a7258d4b6a7f017a81b125275dac1aa166.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index fd4275f..9da1437 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1527,10 +1527,12 @@ static uint64_t rotateSign(int64_t I) { void ModuleBitcodeWriter::writeDISubrange(const DISubrange *N, SmallVectorImpl<uint64_t> &Record, unsigned Abbrev) { - const uint64_t Version = 1 << 1; + const uint64_t Version = 2 << 1; Record.push_back((uint64_t)N->isDistinct() | Version); Record.push_back(VE.getMetadataOrNullID(N->getRawCountNode())); - Record.push_back(rotateSign(N->getLowerBound())); + Record.push_back(VE.getMetadataOrNullID(N->getRawLowerBound())); + Record.push_back(VE.getMetadataOrNullID(N->getRawUpperBound())); + Record.push_back(VE.getMetadataOrNullID(N->getRawStride())); Stream.EmitRecord(bitc::METADATA_SUBRANGE, Record, Abbrev); Record.clear(); |