llvm.org GIT mirror llvm / b145b4e
Fix some signed / unsigned conversion problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328881 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 5 months ago
1 changed file(s) with 15 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
338338 const SubstreamRangeT &Substreams) {
339339 uint32_t SubOffset = OffsetInStream;
340340 for (const auto &Entry : Substreams) {
341 if (Entry.Size == 0)
341 if (Entry.Size <= 0)
342342 continue;
343 if (SubOffset < Entry.Size) {
344 P.formatLine("address is at offset {0}/{1} of the {2}.", SubOffset,
345 Entry.Size, Entry.Label);
343 uint32_t S = static_cast(Entry.Size);
344 if (SubOffset < S) {
345 P.formatLine("address is at offset {0}/{1} of the {2}.", SubOffset, S,
346 Entry.Label);
346347 Entry.Explain(P, Stream, SubOffset);
347348 return;
348349 }
349 SubOffset -= Entry.Size;
350 SubOffset -= S;
350351 }
351352 }
352353
359360 assert(Header != nullptr);
360361
361362 struct SubstreamInfo {
362 uint32_t Size;
363 int32_t Size;
363364 StringRef Label;
364365 void (*Explain)(LinePrinter &, DbiStream &, uint32_t);
365366 } Substreams[] = {
366367 {sizeof(DbiStreamHeader), "DBI Stream Header", explainDbiHeaderOffset},
367 {Header->ModiSubstreamSize, "Module Info Substream",
368 {int32_t(Header->ModiSubstreamSize), "Module Info Substream",
368369 explainDbiModiSubstreamOffset},
369 {Header->SecContrSubstreamSize, "Section Contribution Substream",
370 {int32_t(Header->SecContrSubstreamSize), "Section Contribution Substream",
370371 dontExplain},
371 {Header->SectionMapSize, "Section Map", dontExplain},
372 {Header->FileInfoSize, "File Info Substream", dontExplain},
373 {Header->TypeServerSize, "Type Server Map Substream",
372 {int32_t(Header->SectionMapSize), "Section Map", dontExplain},
373 {int32_t(Header->FileInfoSize), "File Info Substream",
374374 dontExplain},
375 {Header->ECSubstreamSize, "Edit & Continue Substream",
375 {int32_t(Header->TypeServerSize), "Type Server Map Substream",
376376 dontExplain},
377 {Header->OptionalDbgHdrSize, "Optional Debug Stream Array",
377 {int32_t(Header->ECSubstreamSize), "Edit & Continue Substream",
378 dontExplain},
379 {int32_t(Header->OptionalDbgHdrSize), "Optional Debug Stream Array",
378380 dontExplain},
379381 };
380382