Comment parsing: keep the column number of the first character to strip ASCII

art correctly when indentation is present


Swift SVN r16656
This commit is contained in:
Dmitri Hrybenko
2014-04-22 16:34:00 +00:00
parent 724ac58301
commit 9928be1030
6 changed files with 44 additions and 23 deletions

View File

@@ -421,11 +421,13 @@ public:
F.getContext().AllocateUninitialized<SingleRawComment>(NumComments);
for (unsigned i = 0; i != NumComments; ++i) {
unsigned StartColumn =
endian::readNext<uint32_t, little, unaligned>(data);
unsigned RawSize = endian::readNext<uint32_t, little, unaligned>(data);
auto RawText = StringRef(reinterpret_cast<const char *>(data), RawSize);
data += RawSize;
new (&Comments[i]) SingleRawComment(RawText);
new (&Comments[i]) SingleRawComment(RawText, StartColumn);
}
result.Raw = RawComment(Comments);
return result;