summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCCodeView.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-05-17 23:50:21 +0000
committerZachary Turner <zturner@google.com>2016-05-17 23:50:21 +0000
commit63a2846e84794b1bd381d5a7d2970e1f0595b6f6 (patch)
treee744577a5840aefa01213100ff87f1e638a895b8 /llvm/lib/MC/MCCodeView.cpp
parentbc619cde52348dcaa9ad5d19a1ca1ff68a60e529 (diff)
downloadbcm5719-llvm-63a2846e84794b1bd381d5a7d2970e1f0595b6f6.tar.gz
bcm5719-llvm-63a2846e84794b1bd381d5a7d2970e1f0595b6f6.zip
[codeview] Some cleanup of Symbol Records.
* Reworks the CVSymbolTypes.def to work similarly to TypeRecords.def. * Moves some enums from SymbolRecords.h to CodeView.h to maintain consistency with how we do type records. * Generalize a few simple things like the record prefix * Define the leaf enum and the kind enum similar to how we do with tyep records. Differential Revision: http://reviews.llvm.org/D20342 Reviewed By: amccarth, rnk llvm-svn: 269867
Diffstat (limited to 'llvm/lib/MC/MCCodeView.cpp')
-rw-r--r--llvm/lib/MC/MCCodeView.cpp20
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);
}
OpenPOWER on IntegriCloud