OSDN Git Service

[pdb] pad source file name buffer at the end instead of the beginning
authorBob Haarman <llvm@inglorion.net>
Thu, 25 May 2017 21:12:15 +0000 (21:12 +0000)
committerBob Haarman <llvm@inglorion.net>
Thu, 25 May 2017 21:12:15 +0000 (21:12 +0000)
commitae12b7b36034f0ce05b80326d78205f52b1dd35c
tree06216b832c466939379157b8da567060e2cabbe5
parent63d6d7548d9edf129ea79cc6a04fb601510c7684
[pdb] pad source file name buffer at the end instead of the beginning

Summary:
DbiStreamBuilder calculated the offset of the source file names inside
the file info substream as the size of the file info substream minus
the size of the file names. Since the file info substream is padded to
a multiple of 4 bytes, this caused the first file name to be aligned
on a 4-byte boundary. By contrast, DbiModuleList would read the file
names immediately after the file name offset table, without skipping
to the next 4-byte boundary. This change makes it so that the file
names are written to the location where DbiModuleList expects them,
and puts any necessary padding for the file info substream after the
file names instead of before it.

Reviewers: amccarth, rnk, zturner

Reviewed By: amccarth, zturner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D33475

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303917 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h
lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp
test/DebugInfo/PDB/Inputs/source-names-1.yaml [new file with mode: 0644]
test/DebugInfo/PDB/Inputs/source-names-2.yaml [new file with mode: 0644]
test/DebugInfo/PDB/pdbdump-source-names.test [new file with mode: 0644]