aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm12/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:39 +0300
commite9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch)
tree64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/MC/MCStreamer.cpp
parent2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff)
downloadydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/MC/MCStreamer.cpp')
-rw-r--r--contrib/libs/llvm12/lib/MC/MCStreamer.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/contrib/libs/llvm12/lib/MC/MCStreamer.cpp b/contrib/libs/llvm12/lib/MC/MCStreamer.cpp
index 50d3fc3c28..4b5ae3cc20 100644
--- a/contrib/libs/llvm12/lib/MC/MCStreamer.cpp
+++ b/contrib/libs/llvm12/lib/MC/MCStreamer.cpp
@@ -22,7 +22,7 @@
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCObjectFileInfo.h"
-#include "llvm/MC/MCPseudoProbe.h"
+#include "llvm/MC/MCPseudoProbe.h"
#include "llvm/MC/MCRegister.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSection.h"
@@ -91,7 +91,7 @@ void MCTargetStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
MCStreamer::MCStreamer(MCContext &Ctx)
: Context(Ctx), CurrentWinFrameInfo(nullptr),
- CurrentProcWinFrameInfoStartIndex(0), UseAssemblerInfoForParsing(false) {
+ CurrentProcWinFrameInfoStartIndex(0), UseAssemblerInfoForParsing(false) {
SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
}
@@ -139,22 +139,22 @@ void MCStreamer::emitIntValue(uint64_t Value, unsigned Size) {
unsigned Index = IsLittleEndian ? 0 : 8 - Size;
emitBytes(StringRef(reinterpret_cast<char *>(&Swapped) + Index, Size));
}
-void MCStreamer::emitIntValue(APInt Value) {
- if (Value.getNumWords() == 1) {
- emitIntValue(Value.getLimitedValue(), Value.getBitWidth() / 8);
- return;
- }
-
- const bool IsLittleEndianTarget = Context.getAsmInfo()->isLittleEndian();
- const bool ShouldSwap = sys::IsLittleEndianHost != IsLittleEndianTarget;
- const APInt Swapped = ShouldSwap ? Value.byteSwap() : Value;
- const unsigned Size = Value.getBitWidth() / 8;
- SmallString<10> Tmp;
- Tmp.resize(Size);
- StoreIntToMemory(Swapped, reinterpret_cast<uint8_t *>(Tmp.data()), Size);
- emitBytes(Tmp.str());
-}
-
+void MCStreamer::emitIntValue(APInt Value) {
+ if (Value.getNumWords() == 1) {
+ emitIntValue(Value.getLimitedValue(), Value.getBitWidth() / 8);
+ return;
+ }
+
+ const bool IsLittleEndianTarget = Context.getAsmInfo()->isLittleEndian();
+ const bool ShouldSwap = sys::IsLittleEndianHost != IsLittleEndianTarget;
+ const APInt Swapped = ShouldSwap ? Value.byteSwap() : Value;
+ const unsigned Size = Value.getBitWidth() / 8;
+ SmallString<10> Tmp;
+ Tmp.resize(Size);
+ StoreIntToMemory(Swapped, reinterpret_cast<uint8_t *>(Tmp.data()), Size);
+ emitBytes(Tmp.str());
+}
+
/// EmitULEB128IntValue - Special case of EmitULEB128Value that avoids the
/// client having to pass in a MCExpr for constant integers.
void MCStreamer::emitULEB128IntValue(uint64_t Value, unsigned PadTo) {
@@ -218,9 +218,9 @@ void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue);
}
-void llvm::MCStreamer::emitNops(int64_t NumBytes, int64_t ControlledNopLen,
- llvm::SMLoc) {}
-
+void llvm::MCStreamer::emitNops(int64_t NumBytes, int64_t ControlledNopLen,
+ llvm::SMLoc) {}
+
/// The implementation in this class just redirects to emitFill.
void MCStreamer::emitZeros(uint64_t NumBytes) { emitFill(NumBytes, 0); }
@@ -274,9 +274,9 @@ bool MCStreamer::hasUnfinishedDwarfFrameInfo() {
MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() {
if (!hasUnfinishedDwarfFrameInfo()) {
- getContext().reportError(getStartTokLoc(),
- "this directive must appear between "
- ".cfi_startproc and .cfi_endproc directives");
+ getContext().reportError(getStartTokLoc(),
+ "this directive must appear between "
+ ".cfi_startproc and .cfi_endproc directives");
return nullptr;
}
return &DwarfFrameInfos.back();
@@ -693,7 +693,7 @@ void MCStreamer::EmitWinCFIStartProc(const MCSymbol *Symbol, SMLoc Loc) {
MCSymbol *StartProc = emitCFILabel();
- CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
+ CurrentProcWinFrameInfoStartIndex = WinFrameInfos.size();
WinFrameInfos.emplace_back(
std::make_unique<WinEH::FrameInfo>(Symbol, StartProc));
CurrentWinFrameInfo = WinFrameInfos.back().get();
@@ -709,13 +709,13 @@ void MCStreamer::EmitWinCFIEndProc(SMLoc Loc) {
MCSymbol *Label = emitCFILabel();
CurFrame->End = Label;
- if (!CurFrame->FuncletOrFuncEnd)
- CurFrame->FuncletOrFuncEnd = CurFrame->End;
-
- for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
- I != E; ++I)
- EmitWindowsUnwindTables(WinFrameInfos[I].get());
- SwitchSection(CurFrame->TextSection);
+ if (!CurFrame->FuncletOrFuncEnd)
+ CurFrame->FuncletOrFuncEnd = CurFrame->End;
+
+ for (size_t I = CurrentProcWinFrameInfoStartIndex, E = WinFrameInfos.size();
+ I != E; ++I)
+ EmitWindowsUnwindTables(WinFrameInfos[I].get());
+ SwitchSection(CurFrame->TextSection);
}
void MCStreamer::EmitWinCFIFuncletOrFuncEnd(SMLoc Loc) {
@@ -974,13 +974,13 @@ void MCStreamer::emitRawText(const Twine &T) {
void MCStreamer::EmitWindowsUnwindTables() {
}
-void MCStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) {
-}
-
-void MCStreamer::Finish(SMLoc EndLoc) {
+void MCStreamer::EmitWindowsUnwindTables(WinEH::FrameInfo *Frame) {
+}
+
+void MCStreamer::Finish(SMLoc EndLoc) {
if ((!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End) ||
(!WinFrameInfos.empty() && !WinFrameInfos.back()->End)) {
- getContext().reportError(EndLoc, "Unfinished frame!");
+ getContext().reportError(EndLoc, "Unfinished frame!");
return;
}
@@ -1043,25 +1043,25 @@ void MCStreamer::emitInstruction(const MCInst &Inst, const MCSubtargetInfo &) {
visitUsedExpr(*Inst.getOperand(i).getExpr());
}
-void MCStreamer::emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type,
- uint64_t Attr,
- const MCPseudoProbeInlineStack &InlineStack) {
- auto &Context = getContext();
-
- // Create a symbol at in the current section for use in the probe.
- MCSymbol *ProbeSym = Context.createTempSymbol();
-
- // Set the value of the symbol to use for the MCPseudoProbe.
- emitLabel(ProbeSym);
-
- // Create a (local) probe entry with the symbol.
- MCPseudoProbe Probe(ProbeSym, Guid, Index, Type, Attr);
-
- // Add the probe entry to this section's entries.
- Context.getMCPseudoProbeTable().getProbeSections().addPseudoProbe(
- getCurrentSectionOnly(), Probe, InlineStack);
-}
-
+void MCStreamer::emitPseudoProbe(uint64_t Guid, uint64_t Index, uint64_t Type,
+ uint64_t Attr,
+ const MCPseudoProbeInlineStack &InlineStack) {
+ auto &Context = getContext();
+
+ // Create a symbol at in the current section for use in the probe.
+ MCSymbol *ProbeSym = Context.createTempSymbol();
+
+ // Set the value of the symbol to use for the MCPseudoProbe.
+ emitLabel(ProbeSym);
+
+ // Create a (local) probe entry with the symbol.
+ MCPseudoProbe Probe(ProbeSym, Guid, Index, Type, Attr);
+
+ // Add the probe entry to this section's entries.
+ Context.getMCPseudoProbeTable().getProbeSections().addPseudoProbe(
+ getCurrentSectionOnly(), Probe, InlineStack);
+}
+
void MCStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
unsigned Size) {
// Get the Hi-Lo expression.
@@ -1076,7 +1076,7 @@ void MCStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
}
// Otherwise, emit with .set (aka assignment).
- MCSymbol *SetLabel = Context.createTempSymbol("set");
+ MCSymbol *SetLabel = Context.createTempSymbol("set");
emitAssignment(SetLabel, Diff);
emitSymbolValue(SetLabel, Size);
}