summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-12-28 23:45:54 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-12-28 23:45:54 +0000
commit5022bb723853051a17d983322d30dfdac76d0914 (patch)
tree472a39c0b95ed89077d899f8d1f15ddf5eb751e1 /llvm/lib/Bitcode
parent6c37d298d9e7291946c4c75d981902b496e9bd8b (diff)
downloadbcm5719-llvm-5022bb723853051a17d983322d30dfdac76d0914.tar.gz
bcm5719-llvm-5022bb723853051a17d983322d30dfdac76d0914.zip
Change Metadata Index emission in the bitcode to use 2x32 bits for the placeholder
The Bitstream reader and writer are limited to handle a "size_t" at most, which means that we can't backpatch and read back a 64bits value on 32 bits platform. llvm-svn: 290693
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index b7f753e1d62..c10ba2399e7 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1920,7 +1920,8 @@ void ModuleBitcodeWriter::writeModuleMetadata() {
BitCodeAbbrev *Abbv = new BitCodeAbbrev();
Abbv->Add(BitCodeAbbrevOp(bitc::METADATA_INDEX_OFFSET));
- Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 64));
+ Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
+ Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32));
unsigned OffsetAbbrev = Stream.EmitAbbrev(Abbv);
Abbv = new BitCodeAbbrev();
@@ -1939,7 +1940,7 @@ void ModuleBitcodeWriter::writeModuleMetadata() {
// which is written after the records, so that it can include
// the offset of each entry. The placeholder offset will be
// updated after all records are emitted.
- uint64_t Vals[] = {0};
+ uint64_t Vals[] = {0, 0};
Stream.EmitRecord(bitc::METADATA_INDEX_OFFSET, Vals, OffsetAbbrev);
}
OpenPOWER on IntegriCloud