LCOV - code coverage report
Current view: top level - lib/MC - MCStreamer.cpp (source / functions) Hit Total Coverage
Test: llvm-toolchain.info Lines: 482 556 86.7 %
Date: 2017-09-14 15:23:50 Functions: 100 131 76.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //===- lib/MC/MCStreamer.cpp - Streaming Machine Code Output --------------===//
       2             : //
       3             : //                     The LLVM Compiler Infrastructure
       4             : //
       5             : // This file is distributed under the University of Illinois Open Source
       6             : // License. See LICENSE.TXT for details.
       7             : //
       8             : //===----------------------------------------------------------------------===//
       9             : 
      10             : #include "llvm/MC/MCStreamer.h"
      11             : #include "llvm/ADT/SmallString.h"
      12             : #include "llvm/ADT/StringRef.h"
      13             : #include "llvm/ADT/Twine.h"
      14             : #include "llvm/BinaryFormat/COFF.h"
      15             : #include "llvm/MC/MCAsmBackend.h"
      16             : #include "llvm/MC/MCAsmInfo.h"
      17             : #include "llvm/MC/MCCodeView.h"
      18             : #include "llvm/MC/MCContext.h"
      19             : #include "llvm/MC/MCDwarf.h"
      20             : #include "llvm/MC/MCExpr.h"
      21             : #include "llvm/MC/MCInst.h"
      22             : #include "llvm/MC/MCInstPrinter.h"
      23             : #include "llvm/MC/MCObjectFileInfo.h"
      24             : #include "llvm/MC/MCSection.h"
      25             : #include "llvm/MC/MCSectionCOFF.h"
      26             : #include "llvm/MC/MCSymbol.h"
      27             : #include "llvm/MC/MCWin64EH.h"
      28             : #include "llvm/MC/MCWinEH.h"
      29             : #include "llvm/Support/Casting.h"
      30             : #include "llvm/Support/ErrorHandling.h"
      31             : #include "llvm/Support/LEB128.h"
      32             : #include "llvm/Support/MathExtras.h"
      33             : #include "llvm/Support/raw_ostream.h"
      34             : #include <cassert>
      35             : #include <cstdint>
      36             : #include <cstdlib>
      37             : #include <utility>
      38             : 
      39             : using namespace llvm;
      40             : 
      41       11708 : MCTargetStreamer::MCTargetStreamer(MCStreamer &S) : Streamer(S) {
      42       11708 :   S.setTargetStreamer(this);
      43       11708 : }
      44             : 
      45             : // Pin the vtables to this file.
      46             : MCTargetStreamer::~MCTargetStreamer() = default;
      47             : 
      48      173207 : void MCTargetStreamer::emitLabel(MCSymbol *Symbol) {}
      49             : 
      50        5718 : void MCTargetStreamer::finish() {}
      51             : 
      52         827 : void MCTargetStreamer::emitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
      53             : 
      54       22000 : MCStreamer::MCStreamer(MCContext &Ctx)
      55      132000 :     : Context(Ctx), CurrentWinFrameInfo(nullptr) {
      56       44000 :   SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
      57       22000 : }
      58             : 
      59      131196 : MCStreamer::~MCStreamer() {
      60       43764 :   for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
      61          48 :     delete WinFrameInfos[i];
      62       21866 : }
      63             : 
      64       16755 : void MCStreamer::reset() {
      65       33510 :   DwarfFrameInfos.clear();
      66       34266 :   for (unsigned i = 0; i < getNumWinFrameInfos(); ++i)
      67        1134 :     delete WinFrameInfos[i];
      68       33510 :   WinFrameInfos.clear();
      69       16755 :   CurrentWinFrameInfo = nullptr;
      70       16755 :   SymbolOrdering.clear();
      71       33512 :   SectionStack.clear();
      72       33512 :   SectionStack.push_back(std::pair<MCSectionSubPair, MCSectionSubPair>());
      73       16756 : }
      74             : 
      75           0 : raw_ostream &MCStreamer::GetCommentOS() {
      76             :   // By default, discard comments.
      77           0 :   return nulls();
      78             : }
      79             : 
      80         847 : void MCStreamer::emitRawComment(const Twine &T, bool TabPrefix) {}
      81             : 
      82         282 : void MCStreamer::addExplicitComment(const Twine &T) {}
      83           0 : void MCStreamer::emitExplicitComments() {}
      84             : 
      85         960 : void MCStreamer::generateCompactUnwindEncodings(MCAsmBackend *MAB) {
      86       10919 :   for (auto &FI : DwarfFrameInfos)
      87        7079 :     FI.CompactUnwindEncoding =
      88       14457 :         (MAB ? MAB->generateCompactUnwindEncoding(FI.Instructions) : 0);
      89         960 : }
      90             : 
      91             : /// EmitIntValue - Special case of EmitValue that avoids the client having to
      92             : /// pass in a MCExpr for constant integers.
      93     4435759 : void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size) {
      94             :   assert(1 <= Size && Size <= 8 && "Invalid size");
      95             :   assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) &&
      96             :          "Invalid size");
      97             :   char buf[8];
      98     4435759 :   const bool isLittleEndian = Context.getAsmInfo()->isLittleEndian();
      99    21211207 :   for (unsigned i = 0; i != Size; ++i) {
     100    16775448 :     unsigned index = isLittleEndian ? i : (Size - i - 1);
     101    16775448 :     buf[i] = uint8_t(Value >> (index * 8));
     102             :   }
     103     8871518 :   EmitBytes(StringRef(buf, Size));
     104     4435759 : }
     105             : 
     106             : /// EmitULEB128Value - Special case of EmitULEB128Value that avoids the
     107             : /// client having to pass in a MCExpr for constant integers.
     108     1109687 : void MCStreamer::EmitULEB128IntValue(uint64_t Value, unsigned Padding) {
     109     2219374 :   SmallString<128> Tmp;
     110     2219374 :   raw_svector_ostream OSE(Tmp);
     111     1109687 :   encodeULEB128(Value, OSE, Padding);
     112     2219374 :   EmitBytes(OSE.str());
     113     1109687 : }
     114             : 
     115             : /// EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the
     116             : /// client having to pass in a MCExpr for constant integers.
     117        4058 : void MCStreamer::EmitSLEB128IntValue(int64_t Value) {
     118        8116 :   SmallString<128> Tmp;
     119        8116 :   raw_svector_ostream OSE(Tmp);
     120        4058 :   encodeSLEB128(Value, OSE);
     121        8116 :   EmitBytes(OSE.str());
     122        4058 : }
     123             : 
     124      656421 : void MCStreamer::EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc) {
     125      656421 :   EmitValueImpl(Value, Size, Loc);
     126      656421 : }
     127             : 
     128      389802 : void MCStreamer::EmitSymbolValue(const MCSymbol *Sym, unsigned Size,
     129             :                                  bool IsSectionRelative) {
     130             :   assert((!IsSectionRelative || Size == 4) &&
     131             :          "SectionRelative value requires 4-bytes");
     132             : 
     133      389802 :   if (!IsSectionRelative)
     134      779592 :     EmitValueImpl(MCSymbolRefExpr::create(Sym, getContext()), Size);
     135             :   else
     136           6 :     EmitCOFFSecRel32(Sym, /*Offset=*/0);
     137      389802 : }
     138             : 
     139           0 : void MCStreamer::EmitDTPRel64Value(const MCExpr *Value) {
     140           0 :   report_fatal_error("unsupported directive in streamer");
     141             : }
     142             : 
     143           0 : void MCStreamer::EmitDTPRel32Value(const MCExpr *Value) {
     144           0 :   report_fatal_error("unsupported directive in streamer");
     145             : }
     146             : 
     147           0 : void MCStreamer::EmitTPRel64Value(const MCExpr *Value) {
     148           0 :   report_fatal_error("unsupported directive in streamer");
     149             : }
     150             : 
     151           0 : void MCStreamer::EmitTPRel32Value(const MCExpr *Value) {
     152           0 :   report_fatal_error("unsupported directive in streamer");
     153             : }
     154             : 
     155           0 : void MCStreamer::EmitGPRel64Value(const MCExpr *Value) {
     156           0 :   report_fatal_error("unsupported directive in streamer");
     157             : }
     158             : 
     159           0 : void MCStreamer::EmitGPRel32Value(const MCExpr *Value) {
     160           0 :   report_fatal_error("unsupported directive in streamer");
     161             : }
     162             : 
     163             : /// Emit NumBytes bytes worth of the value specified by FillValue.
     164             : /// This implements directives such as '.space'.
     165           7 : void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
     166           7 :   for (uint64_t i = 0, e = NumBytes; i != e; ++i)
     167           0 :     EmitIntValue(FillValue, 1);
     168           7 : }
     169             : 
     170         505 : void MCStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) {
     171         505 :   int64_t NonZeroSize = Size > 4 ? 4 : Size;
     172         505 :   Expr &= ~0ULL >> (64 - NonZeroSize * 8);
     173      628043 :   for (uint64_t i = 0, e = NumValues; i != e; ++i) {
     174      627538 :     EmitIntValue(Expr, NonZeroSize);
     175      627538 :     if (NonZeroSize < Size)
     176           7 :       EmitIntValue(0, Size - NonZeroSize);
     177             :   }
     178         505 : }
     179             : 
     180             : /// The implementation in this class just redirects to emitFill.
     181       63300 : void MCStreamer::EmitZeros(uint64_t NumBytes) {
     182       63300 :   emitFill(NumBytes, 0);
     183       63300 : }
     184             : 
     185      550636 : unsigned MCStreamer::EmitDwarfFileDirective(unsigned FileNo,
     186             :                                             StringRef Directory,
     187             :                                             StringRef Filename, unsigned CUID) {
     188      550636 :   return getContext().getDwarfFile(Directory, Filename, FileNo, CUID);
     189             : }
     190             : 
     191      421768 : void MCStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
     192             :                                        unsigned Column, unsigned Flags,
     193             :                                        unsigned Isa,
     194             :                                        unsigned Discriminator,
     195             :                                        StringRef FileName) {
     196      843536 :   getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa,
     197             :                                   Discriminator);
     198      421768 : }
     199             : 
     200         763 : MCSymbol *MCStreamer::getDwarfLineTableSymbol(unsigned CUID) {
     201        1526 :   MCDwarfLineTable &Table = getContext().getMCDwarfLineTable(CUID);
     202         763 :   if (!Table.getLabel()) {
     203         754 :     StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix();
     204        1508 :     Table.setLabel(
     205        3770 :         Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
     206             :   }
     207         763 :   return Table.getLabel();
     208             : }
     209             : 
     210      674725 : MCDwarfFrameInfo *MCStreamer::getCurrentDwarfFrameInfo() {
     211     1349450 :   if (DwarfFrameInfos.empty())
     212             :     return nullptr;
     213     1334106 :   return &DwarfFrameInfos.back();
     214             : }
     215             : 
     216       79467 : bool MCStreamer::hasUnfinishedDwarfFrameInfo() {
     217       79467 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     218       79467 :   return CurFrame && !CurFrame->End;
     219             : }
     220             : 
     221      297629 : void MCStreamer::EnsureValidDwarfFrame() {
     222      297629 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     223      297629 :   if (!CurFrame || CurFrame->End)
     224           0 :     report_fatal_error("No open frame");
     225      297629 : }
     226             : 
     227          60 : bool MCStreamer::EmitCVFileDirective(unsigned FileNo, StringRef Filename) {
     228          60 :   return getContext().getCVContext().addFile(FileNo, Filename);
     229             : }
     230             : 
     231         155 : bool MCStreamer::EmitCVFuncIdDirective(unsigned FunctionId) {
     232         155 :   return getContext().getCVContext().recordFunctionId(FunctionId);
     233             : }
     234             : 
     235          31 : bool MCStreamer::EmitCVInlineSiteIdDirective(unsigned FunctionId,
     236             :                                              unsigned IAFunc, unsigned IAFile,
     237             :                                              unsigned IALine, unsigned IACol,
     238             :                                              SMLoc Loc) {
     239          62 :   if (getContext().getCVContext().getCVFunctionInfo(IAFunc) == nullptr) {
     240           0 :     getContext().reportError(Loc, "parent function id not introduced by "
     241             :                                   ".cv_func_id or .cv_inline_site_id");
     242           0 :     return true;
     243             :   }
     244             : 
     245          31 :   return getContext().getCVContext().recordInlinedCallSiteId(
     246          31 :       FunctionId, IAFunc, IAFile, IALine, IACol);
     247             : }
     248             : 
     249         563 : void MCStreamer::EmitCVLocDirective(unsigned FunctionId, unsigned FileNo,
     250             :                                     unsigned Line, unsigned Column,
     251             :                                     bool PrologueEnd, bool IsStmt,
     252             :                                     StringRef FileName, SMLoc Loc) {
     253         563 :   CodeViewContext &CVC = getContext().getCVContext();
     254         563 :   MCCVFunctionInfo *FI = CVC.getCVFunctionInfo(FunctionId);
     255             :   if (!FI)
     256           0 :     return getContext().reportError(
     257           0 :         Loc, "function id not introduced by .cv_func_id or .cv_inline_site_id");
     258             : 
     259             :   // Track the section
     260         563 :   if (FI->Section == nullptr)
     261         181 :     FI->Section = getCurrentSectionOnly();
     262         764 :   else if (FI->Section != getCurrentSectionOnly())
     263           2 :     return getContext().reportError(
     264             :         Loc,
     265           1 :         "all .cv_loc directives for a function must be in the same section");
     266             : 
     267         562 :   CVC.setCurrentCVLoc(FunctionId, FileNo, Line, Column, PrologueEnd, IsStmt);
     268             : }
     269             : 
     270         150 : void MCStreamer::EmitCVLinetableDirective(unsigned FunctionId,
     271             :                                           const MCSymbol *Begin,
     272         150 :                                           const MCSymbol *End) {}
     273             : 
     274          29 : void MCStreamer::EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId,
     275             :                                                 unsigned SourceFileId,
     276             :                                                 unsigned SourceLineNum,
     277             :                                                 const MCSymbol *FnStartSym,
     278          29 :                                                 const MCSymbol *FnEndSym) {}
     279             : 
     280         140 : void MCStreamer::EmitCVDefRangeDirective(
     281             :     ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
     282         140 :     StringRef FixedSizePortion) {}
     283             : 
     284           0 : void MCStreamer::EmitEHSymAttributes(const MCSymbol *Symbol,
     285             :                                      MCSymbol *EHSymbol) {
     286           0 : }
     287             : 
     288       17867 : void MCStreamer::InitSections(bool NoExecStack) {
     289       17867 :   SwitchSection(getContext().getObjectFileInfo()->getTextSection());
     290       17867 : }
     291             : 
     292         350 : void MCStreamer::AssignFragment(MCSymbol *Symbol, MCFragment *Fragment) {
     293             :   assert(Fragment);
     294         350 :   Symbol->setFragment(Fragment);
     295             : 
     296             :   // As we emit symbols into a section, track the order so that they can
     297             :   // be sorted upon later. Zero is reserved to mean 'unemitted'.
     298        1050 :   SymbolOrdering[Symbol] = 1 + SymbolOrdering.size();
     299         350 : }
     300             : 
     301     1617226 : void MCStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
     302     1617226 :   Symbol->redefineIfPossible();
     303             : 
     304     3234431 :   if (!Symbol->isUndefined() || Symbol->isVariable())
     305          42 :     return getContext().reportError(Loc, "invalid symbol redefinition");
     306             : 
     307             :   assert(!Symbol->isVariable() && "Cannot emit a variable symbol!");
     308             :   assert(getCurrentSectionOnly() && "Cannot emit before setting section!");
     309             :   assert(!Symbol->getFragment() && "Unexpected fragment on symbol data!");
     310             :   assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
     311             : 
     312     4851615 :   Symbol->setFragment(&getCurrentSectionOnly()->getDummyFragment());
     313             : 
     314     1617205 :   MCTargetStreamer *TS = getTargetStreamer();
     315     1617205 :   if (TS)
     316      178262 :     TS->emitLabel(Symbol);
     317             : }
     318             : 
     319         204 : void MCStreamer::EmitCFISections(bool EH, bool Debug) {
     320             :   assert(EH || Debug);
     321         204 : }
     322             : 
     323       79467 : void MCStreamer::EmitCFIStartProc(bool IsSimple) {
     324       79467 :   if (hasUnfinishedDwarfFrameInfo())
     325           0 :     report_fatal_error("Starting a frame before finishing the previous one!");
     326             : 
     327      158934 :   MCDwarfFrameInfo Frame;
     328       79467 :   Frame.IsSimple = IsSimple;
     329       79467 :   EmitCFIStartProcImpl(Frame);
     330             : 
     331       79467 :   const MCAsmInfo* MAI = Context.getAsmInfo();
     332       79467 :   if (MAI) {
     333      448526 :     for (const MCCFIInstruction& Inst : MAI->getInitialFrameState()) {
     334      130658 :       if (Inst.getOperation() == MCCFIInstruction::OpDefCfa ||
     335             :           Inst.getOperation() == MCCFIInstruction::OpDefCfaRegister) {
     336       79315 :         Frame.CurrentCfaRegister = Inst.getRegister();
     337             :       }
     338             :     }
     339             :   }
     340             : 
     341       79467 :   DwarfFrameInfos.push_back(Frame);
     342       79467 : }
     343             : 
     344          12 : void MCStreamer::EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame) {
     345          12 : }
     346             : 
     347       79466 : void MCStreamer::EmitCFIEndProc() {
     348       79466 :   EnsureValidDwarfFrame();
     349       79466 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     350       79466 :   EmitCFIEndProcImpl(*CurFrame);
     351       79466 : }
     352             : 
     353       72387 : void MCStreamer::EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
     354             :   // Put a dummy non-null value in Frame.End to mark that this frame has been
     355             :   // closed.
     356       72387 :   Frame.End = (MCSymbol *) 1;
     357       72387 : }
     358             : 
     359      215441 : MCSymbol *MCStreamer::EmitCFILabel() {
     360      430882 :   MCSymbol *Label = getContext().createTempSymbol("cfi", true);
     361      215441 :   EmitLabel(Label);
     362      215441 :   return Label;
     363             : }
     364             : 
     365      213301 : MCSymbol *MCStreamer::EmitCFICommon() {
     366      213301 :   EnsureValidDwarfFrame();
     367      213301 :   return EmitCFILabel();
     368             : }
     369             : 
     370        1747 : void MCStreamer::EmitCFIDefCfa(int64_t Register, int64_t Offset) {
     371        1747 :   MCSymbol *Label = EmitCFICommon();
     372             :   MCCFIInstruction Instruction =
     373        5241 :     MCCFIInstruction::createDefCfa(Label, Register, Offset);
     374        1747 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     375        1747 :   CurFrame->Instructions.push_back(Instruction);
     376        1747 :   CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
     377        1747 : }
     378             : 
     379       28537 : void MCStreamer::EmitCFIDefCfaOffset(int64_t Offset) {
     380       28537 :   MCSymbol *Label = EmitCFICommon();
     381             :   MCCFIInstruction Instruction =
     382       85611 :     MCCFIInstruction::createDefCfaOffset(Label, Offset);
     383       28537 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     384       28537 :   CurFrame->Instructions.push_back(Instruction);
     385       28537 : }
     386             : 
     387      140306 : void MCStreamer::EmitCFIAdjustCfaOffset(int64_t Adjustment) {
     388      140306 :   MCSymbol *Label = EmitCFICommon();
     389             :   MCCFIInstruction Instruction =
     390      420918 :     MCCFIInstruction::createAdjustCfaOffset(Label, Adjustment);
     391      140306 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     392      140306 :   CurFrame->Instructions.push_back(Instruction);
     393      140306 : }
     394             : 
     395        2134 : void MCStreamer::EmitCFIDefCfaRegister(int64_t Register) {
     396        2134 :   MCSymbol *Label = EmitCFICommon();
     397             :   MCCFIInstruction Instruction =
     398        6402 :     MCCFIInstruction::createDefCfaRegister(Label, Register);
     399        2134 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     400        2134 :   CurFrame->Instructions.push_back(Instruction);
     401        2134 :   CurFrame->CurrentCfaRegister = static_cast<unsigned>(Register);
     402        2134 : }
     403             : 
     404       31702 : void MCStreamer::EmitCFIOffset(int64_t Register, int64_t Offset) {
     405       31702 :   MCSymbol *Label = EmitCFICommon();
     406             :   MCCFIInstruction Instruction =
     407       95106 :     MCCFIInstruction::createOffset(Label, Register, Offset);
     408       31702 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     409       31702 :   CurFrame->Instructions.push_back(Instruction);
     410       31702 : }
     411             : 
     412          23 : void MCStreamer::EmitCFIRelOffset(int64_t Register, int64_t Offset) {
     413          23 :   MCSymbol *Label = EmitCFICommon();
     414             :   MCCFIInstruction Instruction =
     415          69 :     MCCFIInstruction::createRelOffset(Label, Register, Offset);
     416          23 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     417          23 :   CurFrame->Instructions.push_back(Instruction);
     418          23 : }
     419             : 
     420        2445 : void MCStreamer::EmitCFIPersonality(const MCSymbol *Sym,
     421             :                                     unsigned Encoding) {
     422        2445 :   EnsureValidDwarfFrame();
     423        2445 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     424        2445 :   CurFrame->Personality = Sym;
     425        2445 :   CurFrame->PersonalityEncoding = Encoding;
     426        2445 : }
     427             : 
     428        2410 : void MCStreamer::EmitCFILsda(const MCSymbol *Sym, unsigned Encoding) {
     429        2410 :   EnsureValidDwarfFrame();
     430        2410 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     431        2410 :   CurFrame->Lsda = Sym;
     432        2410 :   CurFrame->LsdaEncoding = Encoding;
     433        2410 : }
     434             : 
     435          30 : void MCStreamer::EmitCFIRememberState() {
     436          30 :   MCSymbol *Label = EmitCFICommon();
     437          60 :   MCCFIInstruction Instruction = MCCFIInstruction::createRememberState(Label);
     438          30 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     439          30 :   CurFrame->Instructions.push_back(Instruction);
     440          30 : }
     441             : 
     442          30 : void MCStreamer::EmitCFIRestoreState() {
     443             :   // FIXME: Error if there is no matching cfi_remember_state.
     444          30 :   MCSymbol *Label = EmitCFICommon();
     445          60 :   MCCFIInstruction Instruction = MCCFIInstruction::createRestoreState(Label);
     446          30 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     447          30 :   CurFrame->Instructions.push_back(Instruction);
     448          30 : }
     449             : 
     450           6 : void MCStreamer::EmitCFISameValue(int64_t Register) {
     451           6 :   MCSymbol *Label = EmitCFICommon();
     452             :   MCCFIInstruction Instruction =
     453          18 :     MCCFIInstruction::createSameValue(Label, Register);
     454           6 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     455           6 :   CurFrame->Instructions.push_back(Instruction);
     456           6 : }
     457             : 
     458           1 : void MCStreamer::EmitCFIRestore(int64_t Register) {
     459           1 :   MCSymbol *Label = EmitCFICommon();
     460             :   MCCFIInstruction Instruction =
     461           3 :     MCCFIInstruction::createRestore(Label, Register);
     462           1 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     463           1 :   CurFrame->Instructions.push_back(Instruction);
     464           1 : }
     465             : 
     466           1 : void MCStreamer::EmitCFIEscape(StringRef Values) {
     467           1 :   MCSymbol *Label = EmitCFICommon();
     468           2 :   MCCFIInstruction Instruction = MCCFIInstruction::createEscape(Label, Values);
     469           1 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     470           1 :   CurFrame->Instructions.push_back(Instruction);
     471           1 : }
     472             : 
     473        8014 : void MCStreamer::EmitCFIGnuArgsSize(int64_t Size) {
     474        8014 :   MCSymbol *Label = EmitCFICommon();
     475             :   MCCFIInstruction Instruction = 
     476       24042 :     MCCFIInstruction::createGnuArgsSize(Label, Size);
     477        8014 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     478        8014 :   CurFrame->Instructions.push_back(Instruction);
     479        8014 : }
     480             : 
     481           1 : void MCStreamer::EmitCFISignalFrame() {
     482           1 :   EnsureValidDwarfFrame();
     483           1 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     484           1 :   CurFrame->IsSignalFrame = true;
     485           1 : }
     486             : 
     487           1 : void MCStreamer::EmitCFIUndefined(int64_t Register) {
     488           1 :   MCSymbol *Label = EmitCFICommon();
     489             :   MCCFIInstruction Instruction =
     490           3 :     MCCFIInstruction::createUndefined(Label, Register);
     491           1 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     492           1 :   CurFrame->Instructions.push_back(Instruction);
     493           1 : }
     494             : 
     495         385 : void MCStreamer::EmitCFIRegister(int64_t Register1, int64_t Register2) {
     496         385 :   MCSymbol *Label = EmitCFICommon();
     497             :   MCCFIInstruction Instruction =
     498        1155 :     MCCFIInstruction::createRegister(Label, Register1, Register2);
     499         385 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     500         385 :   CurFrame->Instructions.push_back(Instruction);
     501         385 : }
     502             : 
     503         384 : void MCStreamer::EmitCFIWindowSave() {
     504         384 :   MCSymbol *Label = EmitCFICommon();
     505             :   MCCFIInstruction Instruction =
     506         768 :     MCCFIInstruction::createWindowSave(Label);
     507         384 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     508         384 :   CurFrame->Instructions.push_back(Instruction);
     509         384 : }
     510             : 
     511           6 : void MCStreamer::EmitCFIReturnColumn(int64_t Register) {
     512           6 :   EnsureValidDwarfFrame();
     513           6 :   MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
     514           6 :   CurFrame->RAReg = Register;
     515           6 : }
     516             : 
     517        2258 : void MCStreamer::EnsureValidWinFrameInfo() {
     518        2258 :   const MCAsmInfo *MAI = Context.getAsmInfo();
     519             :   if (!MAI->usesWindowsCFI())
     520           0 :     report_fatal_error(".seh_* directives are not supported on this target");
     521        4516 :   if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End)
     522           0 :     report_fatal_error("No open Win64 EH frame function!");
     523        2258 : }
     524             : 
     525         393 : void MCStreamer::EmitWinCFIStartProc(const MCSymbol *Symbol) {
     526         393 :   const MCAsmInfo *MAI = Context.getAsmInfo();
     527             :   if (!MAI->usesWindowsCFI())
     528           0 :     report_fatal_error(".seh_* directives are not supported on this target");
     529         645 :   if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
     530           0 :     report_fatal_error("Starting a function before ending the previous one!");
     531             : 
     532         393 :   MCSymbol *StartProc = EmitCFILabel();
     533             : 
     534        1179 :   WinFrameInfos.push_back(new WinEH::FrameInfo(Symbol, StartProc));
     535         786 :   CurrentWinFrameInfo = WinFrameInfos.back();
     536         786 :   CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
     537         393 : }
     538             : 
     539         392 : void MCStreamer::EmitWinCFIEndProc() {
     540         392 :   EnsureValidWinFrameInfo();
     541         392 :   if (CurrentWinFrameInfo->ChainedParent)
     542           0 :     report_fatal_error("Not all chained regions terminated!");
     543             : 
     544         392 :   MCSymbol *Label = EmitCFILabel();
     545         392 :   CurrentWinFrameInfo->End = Label;
     546         392 : }
     547             : 
     548           2 : void MCStreamer::EmitWinCFIStartChained() {
     549           2 :   EnsureValidWinFrameInfo();
     550             : 
     551           2 :   MCSymbol *StartProc = EmitCFILabel();
     552             : 
     553           6 :   WinFrameInfos.push_back(new WinEH::FrameInfo(CurrentWinFrameInfo->Function,
     554           4 :                                                StartProc, CurrentWinFrameInfo));
     555           4 :   CurrentWinFrameInfo = WinFrameInfos.back();
     556           4 :   CurrentWinFrameInfo->TextSection = getCurrentSectionOnly();
     557           2 : }
     558             : 
     559           2 : void MCStreamer::EmitWinCFIEndChained() {
     560           2 :   EnsureValidWinFrameInfo();
     561           2 :   if (!CurrentWinFrameInfo->ChainedParent)
     562           0 :     report_fatal_error("End of a chained region outside a chained region!");
     563             : 
     564           2 :   MCSymbol *Label = EmitCFILabel();
     565             : 
     566           2 :   CurrentWinFrameInfo->End = Label;
     567           2 :   CurrentWinFrameInfo =
     568           2 :       const_cast<WinEH::FrameInfo *>(CurrentWinFrameInfo->ChainedParent);
     569           2 : }
     570             : 
     571         125 : void MCStreamer::EmitWinEHHandler(const MCSymbol *Sym, bool Unwind,
     572             :                                   bool Except) {
     573         125 :   EnsureValidWinFrameInfo();
     574         125 :   if (CurrentWinFrameInfo->ChainedParent)
     575           0 :     report_fatal_error("Chained unwind areas can't have handlers!");
     576         125 :   CurrentWinFrameInfo->ExceptionHandler = Sym;
     577         125 :   if (!Except && !Unwind)
     578           0 :     report_fatal_error("Don't know what kind of handler this is!");
     579         125 :   if (Unwind)
     580         122 :     CurrentWinFrameInfo->HandlesUnwind = true;
     581         125 :   if (Except)
     582         125 :     CurrentWinFrameInfo->HandlesExceptions = true;
     583         125 : }
     584             : 
     585         385 : void MCStreamer::EmitWinEHHandlerData() {
     586         385 :   EnsureValidWinFrameInfo();
     587         385 :   if (CurrentWinFrameInfo->ChainedParent)
     588           0 :     report_fatal_error("Chained unwind areas can't have handlers!");
     589         385 : }
     590             : 
     591         608 : static MCSection *getWinCFISection(MCContext &Context, unsigned *NextWinCFIID,
     592             :                                    MCSection *MainCFISec,
     593             :                                    const MCSection *TextSec) {
     594             :   // If this is the main .text section, use the main unwind info section.
     595         608 :   if (TextSec == Context.getObjectFileInfo()->getTextSection())
     596             :     return MainCFISec;
     597             : 
     598          62 :   const auto *TextSecCOFF = cast<MCSectionCOFF>(TextSec);
     599         124 :   unsigned UniqueID = TextSecCOFF->getOrAssignWinCFISectionID(NextWinCFIID);
     600             : 
     601             :   // If this section is COMDAT, this unwind section should be COMDAT associative
     602             :   // with its group.
     603          62 :   const MCSymbol *KeySym = nullptr;
     604          62 :   if (TextSecCOFF->getCharacteristics() & COFF::IMAGE_SCN_LNK_COMDAT)
     605          58 :     KeySym = TextSecCOFF->getCOMDATSymbol();
     606             : 
     607          62 :   return Context.getAssociativeCOFFSection(cast<MCSectionCOFF>(MainCFISec),
     608          62 :                                            KeySym, UniqueID);
     609             : }
     610             : 
     611          70 : MCSection *MCStreamer::getAssociatedPDataSection(const MCSection *TextSec) {
     612          70 :   return getWinCFISection(getContext(), &NextWinCFIID,
     613          70 :                           getContext().getObjectFileInfo()->getPDataSection(),
     614          70 :                           TextSec);
     615             : }
     616             : 
     617         538 : MCSection *MCStreamer::getAssociatedXDataSection(const MCSection *TextSec) {
     618         538 :   return getWinCFISection(getContext(), &NextWinCFIID,
     619         538 :                           getContext().getObjectFileInfo()->getXDataSection(),
     620         538 :                           TextSec);
     621             : }
     622             : 
     623        1264 : void MCStreamer::EmitSyntaxDirective() {}
     624             : 
     625         367 : void MCStreamer::EmitWinCFIPushReg(unsigned Register) {
     626         367 :   EnsureValidWinFrameInfo();
     627             : 
     628         367 :   MCSymbol *Label = EmitCFILabel();
     629             : 
     630         367 :   WinEH::Instruction Inst = Win64EH::Instruction::PushNonVol(Label, Register);
     631         367 :   CurrentWinFrameInfo->Instructions.push_back(Inst);
     632         367 : }
     633             : 
     634          90 : void MCStreamer::EmitWinCFISetFrame(unsigned Register, unsigned Offset) {
     635          90 :   EnsureValidWinFrameInfo();
     636          90 :   if (CurrentWinFrameInfo->LastFrameInst >= 0)
     637           0 :     report_fatal_error("Frame register and offset already specified!");
     638          90 :   if (Offset & 0x0F)
     639           0 :     report_fatal_error("Misaligned frame pointer offset!");
     640          90 :   if (Offset > 240)
     641           0 :     report_fatal_error("Frame offset must be less than or equal to 240!");
     642             : 
     643          90 :   MCSymbol *Label = EmitCFILabel();
     644             : 
     645             :   WinEH::Instruction Inst =
     646          90 :       Win64EH::Instruction::SetFPReg(Label, Register, Offset);
     647         180 :   CurrentWinFrameInfo->LastFrameInst = CurrentWinFrameInfo->Instructions.size();
     648          90 :   CurrentWinFrameInfo->Instructions.push_back(Inst);
     649          90 : }
     650             : 
     651         358 : void MCStreamer::EmitWinCFIAllocStack(unsigned Size) {
     652         358 :   EnsureValidWinFrameInfo();
     653         358 :   if (Size == 0)
     654           1 :     report_fatal_error("Allocation size must be non-zero!");
     655         357 :   if (Size & 7)
     656           0 :     report_fatal_error("Misaligned stack allocation!");
     657             : 
     658         357 :   MCSymbol *Label = EmitCFILabel();
     659             : 
     660         357 :   WinEH::Instruction Inst = Win64EH::Instruction::Alloc(Label, Size);
     661         357 :   CurrentWinFrameInfo->Instructions.push_back(Inst);
     662         357 : }
     663             : 
     664           2 : void MCStreamer::EmitWinCFISaveReg(unsigned Register, unsigned Offset) {
     665           2 :   EnsureValidWinFrameInfo();
     666           2 :   if (Offset & 7)
     667           0 :     report_fatal_error("Misaligned saved register offset!");
     668             : 
     669           2 :   MCSymbol *Label = EmitCFILabel();
     670             : 
     671             :   WinEH::Instruction Inst =
     672           2 :       Win64EH::Instruction::SaveNonVol(Label, Register, Offset);
     673           2 :   CurrentWinFrameInfo->Instructions.push_back(Inst);
     674           2 : }
     675             : 
     676         143 : void MCStreamer::EmitWinCFISaveXMM(unsigned Register, unsigned Offset) {
     677         143 :   EnsureValidWinFrameInfo();
     678         143 :   if (Offset & 0x0F)
     679           0 :     report_fatal_error("Misaligned saved vector register offset!");
     680             : 
     681         143 :   MCSymbol *Label = EmitCFILabel();
     682             : 
     683             :   WinEH::Instruction Inst =
     684         143 :       Win64EH::Instruction::SaveXMM(Label, Register, Offset);
     685         143 :   CurrentWinFrameInfo->Instructions.push_back(Inst);
     686         143 : }
     687             : 
     688           2 : void MCStreamer::EmitWinCFIPushFrame(bool Code) {
     689           2 :   EnsureValidWinFrameInfo();
     690           4 :   if (!CurrentWinFrameInfo->Instructions.empty())
     691           0 :     report_fatal_error("If present, PushMachFrame must be the first UOP");
     692             : 
     693           2 :   MCSymbol *Label = EmitCFILabel();
     694             : 
     695           4 :   WinEH::Instruction Inst = Win64EH::Instruction::PushMachFrame(Label, Code);
     696           2 :   CurrentWinFrameInfo->Instructions.push_back(Inst);
     697           2 : }
     698             : 
     699         390 : void MCStreamer::EmitWinCFIEndProlog() {
     700         390 :   EnsureValidWinFrameInfo();
     701             : 
     702         390 :   MCSymbol *Label = EmitCFILabel();
     703             : 
     704         390 :   CurrentWinFrameInfo->PrologEnd = Label;
     705         390 : }
     706             : 
     707           0 : void MCStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) {
     708           0 : }
     709             : 
     710           0 : void MCStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) {
     711           0 : }
     712             : 
     713          17 : void MCStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) {}
     714             : 
     715             : /// EmitRawText - If this file is backed by an assembly streamer, this dumps
     716             : /// the specified string in the output .s file.  This capability is
     717             : /// indicated by the hasRawTextSupport() predicate.
     718           0 : void MCStreamer::EmitRawTextImpl(StringRef String) {
     719           0 :   errs() << "EmitRawText called on an MCStreamer that doesn't support it, "
     720             :   " something must not be fully mc'ized\n";
     721           0 :   abort();
     722             : }
     723             : 
     724        9624 : void MCStreamer::EmitRawText(const Twine &T) {
     725       19248 :   SmallString<128> Str;
     726        9624 :   EmitRawTextImpl(T.toStringRef(Str));
     727        9624 : }
     728             : 
     729           0 : void MCStreamer::EmitWindowsUnwindTables() {
     730           0 : }
     731             : 
     732       20438 : void MCStreamer::Finish() {
     733       48544 :   if (!DwarfFrameInfos.empty() && !DwarfFrameInfos.back().End)
     734           1 :     report_fatal_error("Unfinished frame!");
     735             : 
     736       20437 :   MCTargetStreamer *TS = getTargetStreamer();
     737       20437 :   if (TS)
     738       10587 :     TS->finish();
     739             : 
     740       20437 :   FinishImpl();
     741       20423 : }
     742             : 
     743        4629 : void MCStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
     744        4629 :   visitUsedExpr(*Value);
     745        4629 :   Symbol->setVariableValue(Value);
     746             : 
     747        4629 :   MCTargetStreamer *TS = getTargetStreamer();
     748        4629 :   if (TS)
     749         876 :     TS->emitAssignment(Symbol, Value);
     750        4629 : }
     751             : 
     752      925825 : void MCTargetStreamer::prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS,
     753             :                               const MCInst &Inst, const MCSubtargetInfo &STI) {
     754     1851650 :   InstPrinter.printInst(&Inst, OS, "", STI);
     755      925825 : }
     756             : 
     757        2306 : void MCStreamer::visitUsedSymbol(const MCSymbol &Sym) {
     758        2306 : }
     759             : 
     760     1815825 : void MCStreamer::visitUsedExpr(const MCExpr &Expr) {
     761     2198543 :   switch (Expr.getKind()) {
     762        3322 :   case MCExpr::Target:
     763        3322 :     cast<MCTargetExpr>(Expr).visitUsedExpr(*this);
     764        3322 :     break;
     765             : 
     766             :   case MCExpr::Constant:
     767             :     break;
     768             : 
     769      382697 :   case MCExpr::Binary: {
     770      382697 :     const MCBinaryExpr &BE = cast<MCBinaryExpr>(Expr);
     771      382697 :     visitUsedExpr(*BE.getLHS());
     772             :     visitUsedExpr(*BE.getRHS());
     773      382697 :     break;
     774             :   }
     775             : 
     776     1527851 :   case MCExpr::SymbolRef:
     777     3055702 :     visitUsedSymbol(cast<MCSymbolRefExpr>(Expr).getSymbol());
     778     1527851 :     break;
     779             : 
     780          21 :   case MCExpr::Unary:
     781          21 :     visitUsedExpr(*cast<MCUnaryExpr>(Expr).getSubExpr());
     782          21 :     break;
     783             :   }
     784     1815825 : }
     785             : 
     786     1480218 : void MCStreamer::EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI,
     787             :                                  bool) {
     788             :   // Scan for values.
     789     1480218 :   for (unsigned i = Inst.getNumOperands(); i--;)
     790     5662585 :     if (Inst.getOperand(i).isExpr())
     791      727405 :       visitUsedExpr(*Inst.getOperand(i).getExpr());
     792     1480219 : }
     793             : 
     794       65032 : void MCStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo,
     795             :                                         unsigned Size) {
     796             :   // Get the Hi-Lo expression.
     797             :   const MCExpr *Diff =
     798      195096 :       MCBinaryExpr::createSub(MCSymbolRefExpr::create(Hi, Context),
     799      195096 :                               MCSymbolRefExpr::create(Lo, Context), Context);
     800             : 
     801       65032 :   const MCAsmInfo *MAI = Context.getAsmInfo();
     802       65032 :   if (!MAI->doesSetDirectiveSuppressReloc()) {
     803       63501 :     EmitValue(Diff, Size);
     804       63501 :     return;
     805             :   }
     806             : 
     807             :   // Otherwise, emit with .set (aka assignment).
     808        3062 :   MCSymbol *SetLabel = Context.createTempSymbol("set", true);
     809        1531 :   EmitAssignment(SetLabel, Diff);
     810        1531 :   EmitSymbolValue(SetLabel, Size);
     811             : }
     812             : 
     813           4 : void MCStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {}
     814           0 : void MCStreamer::EmitThumbFunc(MCSymbol *Func) {}
     815           0 : void MCStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
     816           0 : void MCStreamer::BeginCOFFSymbolDef(const MCSymbol *Symbol) {
     817           0 :   llvm_unreachable("this directive only supported on COFF targets");
     818             : }
     819           0 : void MCStreamer::EndCOFFSymbolDef() {
     820           0 :   llvm_unreachable("this directive only supported on COFF targets");
     821             : }
     822           8 : void MCStreamer::EmitFileDirective(StringRef Filename) {}
     823           0 : void MCStreamer::EmitCOFFSymbolStorageClass(int StorageClass) {
     824           0 :   llvm_unreachable("this directive only supported on COFF targets");
     825             : }
     826           0 : void MCStreamer::EmitCOFFSymbolType(int Type) {
     827           0 :   llvm_unreachable("this directive only supported on COFF targets");
     828             : }
     829          49 : void MCStreamer::emitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
     830          48 : void MCStreamer::emitELFSymverDirective(MCSymbol *Alias,
     831          48 :                                         const MCSymbol *Aliasee) {}
     832           0 : void MCStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
     833           0 :                                        unsigned ByteAlignment) {}
     834           0 : void MCStreamer::EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol,
     835           0 :                                 uint64_t Size, unsigned ByteAlignment) {}
     836         149 : void MCStreamer::ChangeSection(MCSection *, const MCExpr *) {}
     837           0 : void MCStreamer::EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {}
     838         351 : void MCStreamer::EmitBytes(StringRef Data) {}
     839         657 : void MCStreamer::EmitBinaryData(StringRef Data) { EmitBytes(Data); }
     840      695726 : void MCStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) {
     841      695726 :   visitUsedExpr(*Value);
     842      695726 : }
     843           0 : void MCStreamer::EmitULEB128Value(const MCExpr *Value) {}
     844           0 : void MCStreamer::EmitSLEB128Value(const MCExpr *Value) {}
     845           0 : void MCStreamer::emitFill(const MCExpr &NumBytes, uint64_t Value, SMLoc Loc) {}
     846           0 : void MCStreamer::emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr,
     847           0 :                           SMLoc Loc) {}
     848           4 : void MCStreamer::EmitValueToAlignment(unsigned ByteAlignment, int64_t Value,
     849             :                                       unsigned ValueSize,
     850           4 :                                       unsigned MaxBytesToEmit) {}
     851          28 : void MCStreamer::EmitCodeAlignment(unsigned ByteAlignment,
     852          28 :                                    unsigned MaxBytesToEmit) {}
     853           0 : void MCStreamer::emitValueToOffset(const MCExpr *Offset, unsigned char Value,
     854           0 :                                    SMLoc Loc) {}
     855           0 : void MCStreamer::EmitBundleAlignMode(unsigned AlignPow2) {}
     856           0 : void MCStreamer::EmitBundleLock(bool AlignToEnd) {}
     857         101 : void MCStreamer::FinishImpl() {}
     858           0 : void MCStreamer::EmitBundleUnlock() {}
     859             : 
     860      657083 : void MCStreamer::SwitchSection(MCSection *Section, const MCExpr *Subsection) {
     861             :   assert(Section && "Cannot switch to a null section!");
     862     1314166 :   MCSectionSubPair curSection = SectionStack.back().first;
     863     1971249 :   SectionStack.back().second = curSection;
     864     1314166 :   if (MCSectionSubPair(Section, Subsection) != curSection) {
     865      516702 :     ChangeSection(Section, Subsection);
     866     1550100 :     SectionStack.back().first = MCSectionSubPair(Section, Subsection);
     867             :     assert(!Section->hasEnded() && "Section already ended");
     868      516700 :     MCSymbol *Sym = Section->getBeginSymbol();
     869      516700 :     if (Sym && !Sym->isInSection())
     870        2482 :       EmitLabel(Sym);
     871             :   }
     872      657080 : }
     873             : 
     874        5482 : MCSymbol *MCStreamer::endSection(MCSection *Section) {
     875             :   // TODO: keep track of the last subsection so that this symbol appears in the
     876             :   // correct place.
     877        5482 :   MCSymbol *Sym = Section->getEndSymbol(Context);
     878        5482 :   if (Sym->isInSection())
     879             :     return Sym;
     880             : 
     881        5459 :   SwitchSection(Section);
     882        5459 :   EmitLabel(Sym);
     883        5459 :   return Sym;
     884             : }

Generated by: LCOV version 1.13