diff options
Diffstat (limited to 'llvm/lib/MC/MCCodeView.cpp')
-rw-r--r-- | llvm/lib/MC/MCCodeView.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCCodeView.cpp b/llvm/lib/MC/MCCodeView.cpp index cd19e6aa773..8ae0187237a 100644 --- a/llvm/lib/MC/MCCodeView.cpp +++ b/llvm/lib/MC/MCCodeView.cpp @@ -220,6 +220,11 @@ static bool compressAnnotation(uint32_t Data, SmallVectorImpl<char> &Buffer) { return false; } +static bool compressAnnotation(BinaryAnnotationsOpCode Annotation, + SmallVectorImpl<char> &Buffer) { + return compressAnnotation(static_cast<uint32_t>(Annotation), Buffer); +} + static uint32_t encodeSignedNumber(uint32_t Data) { if (Data >> 31) return ((-Data) << 1) | 1; @@ -302,7 +307,7 @@ void CodeViewContext::encodeInlineLineTable(MCAsmLayout &Layout, if (WithinFunction) { unsigned Length = computeLabelDiff(Layout, LastLoc->getLabel(), Loc.getLabel()); - compressAnnotation(ChangeCodeLength, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeCodeLength, Buffer); compressAnnotation(Length, Buffer); } WithinFunction = false; @@ -314,7 +319,7 @@ void CodeViewContext::encodeInlineLineTable(MCAsmLayout &Layout, // File ids are 1 based, and each file checksum table entry is 8 bytes // long. See emitFileChecksums above. unsigned FileOffset = 8 * (Loc.getFileNum() - 1); - compressAnnotation(ChangeFile, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeFile, Buffer); compressAnnotation(FileOffset, Buffer); } @@ -326,20 +331,21 @@ void CodeViewContext::encodeInlineLineTable(MCAsmLayout &Layout, unsigned CodeDelta = computeLabelDiff(Layout, LastLoc->getLabel(), Loc.getLabel()); if (CodeDelta == 0) { - compressAnnotation(ChangeLineOffset, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeLineOffset, Buffer); compressAnnotation(EncodedLineDelta, Buffer); } else if (EncodedLineDelta < 0x8 && CodeDelta <= 0xf) { // The ChangeCodeOffsetAndLineOffset combination opcode is used when the // encoded line delta uses 3 or fewer set bits and the code offset fits // in one nibble. unsigned Operand = (EncodedLineDelta << 4) | CodeDelta; - compressAnnotation(ChangeCodeOffsetAndLineOffset, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeCodeOffsetAndLineOffset, + Buffer); compressAnnotation(Operand, Buffer); } else { // Otherwise use the separate line and code deltas. - compressAnnotation(ChangeLineOffset, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeLineOffset, Buffer); compressAnnotation(EncodedLineDelta, Buffer); - compressAnnotation(ChangeCodeOffset, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeCodeOffset, Buffer); compressAnnotation(CodeDelta, Buffer); } @@ -362,7 +368,7 @@ void CodeViewContext::encodeInlineLineTable(MCAsmLayout &Layout, } } - compressAnnotation(ChangeCodeLength, Buffer); + compressAnnotation(BinaryAnnotationsOpCode::ChangeCodeLength, Buffer); compressAnnotation(std::min(EndSymLength, LocAfterLength), Buffer); } |