aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/StackMaps.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/StackMaps.cpp')
-rw-r--r--llvm/lib/CodeGen/StackMaps.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp
index e16587c44a55..1e060ecbeb43 100644
--- a/llvm/lib/CodeGen/StackMaps.cpp
+++ b/llvm/lib/CodeGen/StackMaps.cpp
@@ -300,7 +300,7 @@ void StackMaps::recordStackMapOpers(const MCSymbol &MILabel,
MachineInstr::const_mop_iterator MOE,
bool recordResult) {
MCContext &OutContext = AP.OutStreamer->getContext();
-
+
LocationVec Locations;
LiveOutVec LiveOuts;
@@ -413,19 +413,19 @@ void StackMaps::recordStatepoint(const MCSymbol &L, const MachineInstr &MI) {
/// uint32 : NumRecords
void StackMaps::emitStackmapHeader(MCStreamer &OS) {
// Header.
- OS.EmitIntValue(StackMapVersion, 1); // Version.
- OS.EmitIntValue(0, 1); // Reserved.
- OS.EmitIntValue(0, 2); // Reserved.
+ OS.emitIntValue(StackMapVersion, 1); // Version.
+ OS.emitIntValue(0, 1); // Reserved.
+ OS.emitInt16(0); // Reserved.
// Num functions.
LLVM_DEBUG(dbgs() << WSMP << "#functions = " << FnInfos.size() << '\n');
- OS.EmitIntValue(FnInfos.size(), 4);
+ OS.emitInt32(FnInfos.size());
// Num constants.
LLVM_DEBUG(dbgs() << WSMP << "#constants = " << ConstPool.size() << '\n');
- OS.EmitIntValue(ConstPool.size(), 4);
+ OS.emitInt32(ConstPool.size());
// Num callsites.
LLVM_DEBUG(dbgs() << WSMP << "#callsites = " << CSInfos.size() << '\n');
- OS.EmitIntValue(CSInfos.size(), 4);
+ OS.emitInt32(CSInfos.size());
}
/// Emit the function frame record for each function.
@@ -442,9 +442,9 @@ void StackMaps::emitFunctionFrameRecords(MCStreamer &OS) {
LLVM_DEBUG(dbgs() << WSMP << "function addr: " << FR.first
<< " frame size: " << FR.second.StackSize
<< " callsite count: " << FR.second.RecordCount << '\n');
- OS.EmitSymbolValue(FR.first, 8);
- OS.EmitIntValue(FR.second.StackSize, 8);
- OS.EmitIntValue(FR.second.RecordCount, 8);
+ OS.emitSymbolValue(FR.first, 8);
+ OS.emitIntValue(FR.second.StackSize, 8);
+ OS.emitIntValue(FR.second.RecordCount, 8);
}
}
@@ -456,7 +456,7 @@ void StackMaps::emitConstantPoolEntries(MCStreamer &OS) {
LLVM_DEBUG(dbgs() << WSMP << "constants:\n");
for (const auto &ConstEntry : ConstPool) {
LLVM_DEBUG(dbgs() << WSMP << ConstEntry.second << '\n');
- OS.EmitIntValue(ConstEntry.second, 8);
+ OS.emitIntValue(ConstEntry.second, 8);
}
}
@@ -501,46 +501,46 @@ void StackMaps::emitCallsiteEntries(MCStreamer &OS) {
// simple overflow checks, but we may eventually communicate other
// compilation errors this way.
if (CSLocs.size() > UINT16_MAX || LiveOuts.size() > UINT16_MAX) {
- OS.EmitIntValue(UINT64_MAX, 8); // Invalid ID.
- OS.EmitValue(CSI.CSOffsetExpr, 4);
- OS.EmitIntValue(0, 2); // Reserved.
- OS.EmitIntValue(0, 2); // 0 locations.
- OS.EmitIntValue(0, 2); // padding.
- OS.EmitIntValue(0, 2); // 0 live-out registers.
- OS.EmitIntValue(0, 4); // padding.
+ OS.emitIntValue(UINT64_MAX, 8); // Invalid ID.
+ OS.emitValue(CSI.CSOffsetExpr, 4);
+ OS.emitInt16(0); // Reserved.
+ OS.emitInt16(0); // 0 locations.
+ OS.emitInt16(0); // padding.
+ OS.emitInt16(0); // 0 live-out registers.
+ OS.emitInt32(0); // padding.
continue;
}
- OS.EmitIntValue(CSI.ID, 8);
- OS.EmitValue(CSI.CSOffsetExpr, 4);
+ OS.emitIntValue(CSI.ID, 8);
+ OS.emitValue(CSI.CSOffsetExpr, 4);
// Reserved for flags.
- OS.EmitIntValue(0, 2);
- OS.EmitIntValue(CSLocs.size(), 2);
+ OS.emitInt16(0);
+ OS.emitInt16(CSLocs.size());
for (const auto &Loc : CSLocs) {
- OS.EmitIntValue(Loc.Type, 1);
- OS.EmitIntValue(0, 1); // Reserved
- OS.EmitIntValue(Loc.Size, 2);
- OS.EmitIntValue(Loc.Reg, 2);
- OS.EmitIntValue(0, 2); // Reserved
- OS.EmitIntValue(Loc.Offset, 4);
+ OS.emitIntValue(Loc.Type, 1);
+ OS.emitIntValue(0, 1); // Reserved
+ OS.emitInt16(Loc.Size);
+ OS.emitInt16(Loc.Reg);
+ OS.emitInt16(0); // Reserved
+ OS.emitInt32(Loc.Offset);
}
// Emit alignment to 8 byte.
- OS.EmitValueToAlignment(8);
+ OS.emitValueToAlignment(8);
// Num live-out registers and padding to align to 4 byte.
- OS.EmitIntValue(0, 2);
- OS.EmitIntValue(LiveOuts.size(), 2);
+ OS.emitInt16(0);
+ OS.emitInt16(LiveOuts.size());
for (const auto &LO : LiveOuts) {
- OS.EmitIntValue(LO.DwarfRegNum, 2);
- OS.EmitIntValue(0, 1);
- OS.EmitIntValue(LO.Size, 1);
+ OS.emitInt16(LO.DwarfRegNum);
+ OS.emitIntValue(0, 1);
+ OS.emitIntValue(LO.Size, 1);
}
// Emit alignment to 8 byte.
- OS.EmitValueToAlignment(8);
+ OS.emitValueToAlignment(8);
}
}
@@ -564,7 +564,7 @@ void StackMaps::serializeToStackMapSection() {
OS.SwitchSection(StackMapSection);
// Emit a dummy symbol to force section inclusion.
- OS.EmitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_StackMaps")));
+ OS.emitLabel(OutContext.getOrCreateSymbol(Twine("__LLVM_StackMaps")));
// Serialize data.
LLVM_DEBUG(dbgs() << "********** Stack Map Output **********\n");