Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 1 | //===-- llvm/MC/WinCOFFStreamer.cpp -----------------------------*- C++ -*-===// |
| 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 | // |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 10 | // This file contains an implementation of a Windows COFF object file streamer. |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Saleem Abdulrasool | 6663f8f | 2014-05-22 02:18:10 +0000 | [diff] [blame^] | 14 | #include "llvm/ADT/StringExtras.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 15 | #include "llvm/MC/MCStreamer.h" |
Evan Cheng | 5928e69 | 2011-07-25 23:24:55 +0000 | [diff] [blame] | 16 | #include "llvm/MC/MCAsmBackend.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 17 | #include "llvm/MC/MCAsmLayout.h" |
| 18 | #include "llvm/MC/MCAssembler.h" |
| 19 | #include "llvm/MC/MCCodeEmitter.h" |
| 20 | #include "llvm/MC/MCContext.h" |
| 21 | #include "llvm/MC/MCExpr.h" |
Rafael Espindola | e308c0c | 2014-01-23 22:49:25 +0000 | [diff] [blame] | 22 | #include "llvm/MC/MCObjectFileInfo.h" |
Chandler Carruth | ed0881b | 2012-12-03 16:50:05 +0000 | [diff] [blame] | 23 | #include "llvm/MC/MCObjectStreamer.h" |
| 24 | #include "llvm/MC/MCSection.h" |
| 25 | #include "llvm/MC/MCSectionCOFF.h" |
| 26 | #include "llvm/MC/MCSymbol.h" |
| 27 | #include "llvm/MC/MCValue.h" |
| 28 | #include "llvm/MC/MCWin64EH.h" |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 29 | #include "llvm/MC/MCWinCOFFStreamer.h" |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 30 | #include "llvm/Support/COFF.h" |
| 31 | #include "llvm/Support/Debug.h" |
| 32 | #include "llvm/Support/ErrorHandling.h" |
Evan Cheng | 2bb4035 | 2011-08-24 18:08:43 +0000 | [diff] [blame] | 33 | #include "llvm/Support/TargetRegistry.h" |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 34 | #include "llvm/Support/raw_ostream.h" |
Rafael Espindola | d3df3d3 | 2011-12-17 01:14:52 +0000 | [diff] [blame] | 35 | |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 36 | using namespace llvm; |
| 37 | |
Chandler Carruth | f58e376 | 2014-04-22 03:04:17 +0000 | [diff] [blame] | 38 | #define DEBUG_TYPE "WinCOFFStreamer" |
| 39 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 40 | namespace llvm { |
| 41 | MCWinCOFFStreamer::MCWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, |
| 42 | MCCodeEmitter &CE, raw_ostream &OS) |
Craig Topper | bb694de | 2014-04-13 04:57:38 +0000 | [diff] [blame] | 43 | : MCObjectStreamer(Context, MAB, OS, &CE), CurSymbol(nullptr) {} |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 44 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 45 | void MCWinCOFFStreamer::EmitInstToData(const MCInst &Inst, |
| 46 | const MCSubtargetInfo &STI) { |
| 47 | MCDataFragment *DF = getOrCreateDataFragment(); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 48 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 49 | SmallVector<MCFixup, 4> Fixups; |
| 50 | SmallString<256> Code; |
| 51 | raw_svector_ostream VecOS(Code); |
| 52 | getAssembler().getEmitter().EncodeInstruction(Inst, VecOS, Fixups, STI); |
| 53 | VecOS.flush(); |
| 54 | |
| 55 | // Add the fixups and data. |
| 56 | for (unsigned i = 0, e = Fixups.size(); i != e; ++i) { |
| 57 | Fixups[i].setOffset(Fixups[i].getOffset() + DF->getContents().size()); |
| 58 | DF->getFixups().push_back(Fixups[i]); |
| 59 | } |
| 60 | |
| 61 | DF->getContents().append(Code.begin(), Code.end()); |
| 62 | } |
| 63 | |
| 64 | void MCWinCOFFStreamer::InitSections() { |
Rafael Espindola | f281253 | 2014-01-24 02:28:11 +0000 | [diff] [blame] | 65 | // FIXME: this is identical to the ELF one. |
| 66 | // This emulates the same behavior of GNU as. This makes it easier |
| 67 | // to compare the output as the major sections are in the same order. |
| 68 | SwitchSection(getContext().getObjectFileInfo()->getTextSection()); |
Rafael Espindola | 7b51496 | 2014-02-04 18:34:04 +0000 | [diff] [blame] | 69 | EmitCodeAlignment(4); |
Rafael Espindola | f281253 | 2014-01-24 02:28:11 +0000 | [diff] [blame] | 70 | |
| 71 | SwitchSection(getContext().getObjectFileInfo()->getDataSection()); |
Rafael Espindola | 7b51496 | 2014-02-04 18:34:04 +0000 | [diff] [blame] | 72 | EmitCodeAlignment(4); |
Rafael Espindola | f281253 | 2014-01-24 02:28:11 +0000 | [diff] [blame] | 73 | |
| 74 | SwitchSection(getContext().getObjectFileInfo()->getBSSSection()); |
Rafael Espindola | 7b51496 | 2014-02-04 18:34:04 +0000 | [diff] [blame] | 75 | EmitCodeAlignment(4); |
Rafael Espindola | f281253 | 2014-01-24 02:28:11 +0000 | [diff] [blame] | 76 | |
| 77 | SwitchSection(getContext().getObjectFileInfo()->getTextSection()); |
Rafael Espindola | f667d92 | 2010-09-15 21:48:40 +0000 | [diff] [blame] | 78 | } |
| 79 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 80 | void MCWinCOFFStreamer::EmitLabel(MCSymbol *Symbol) { |
Rafael Espindola | 1679580 | 2010-11-28 16:22:59 +0000 | [diff] [blame] | 81 | assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); |
Rafael Espindola | e5b7415 | 2010-11-28 17:18:55 +0000 | [diff] [blame] | 82 | MCObjectStreamer::EmitLabel(Symbol); |
Rafael Espindola | 1679580 | 2010-11-28 16:22:59 +0000 | [diff] [blame] | 83 | } |
| 84 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 85 | void MCWinCOFFStreamer::EmitDebugLabel(MCSymbol *Symbol) { |
Reed Kotler | aee4d5d1 | 2012-12-16 04:00:45 +0000 | [diff] [blame] | 86 | EmitLabel(Symbol); |
| 87 | } |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 88 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 89 | void MCWinCOFFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) { |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 90 | llvm_unreachable("not implemented"); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 91 | } |
| 92 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 93 | void MCWinCOFFStreamer::EmitThumbFunc(MCSymbol *Func) { |
Jim Grosbach | 5a2c68d | 2010-11-05 22:08:08 +0000 | [diff] [blame] | 94 | llvm_unreachable("not implemented"); |
| 95 | } |
| 96 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 97 | bool MCWinCOFFStreamer::EmitSymbolAttribute(MCSymbol *Symbol, |
| 98 | MCSymbolAttr Attribute) { |
Michael J. Spencer | be52c62 | 2010-10-09 11:00:37 +0000 | [diff] [blame] | 99 | assert(Symbol && "Symbol must be non-null!"); |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 100 | assert((!Symbol->isInSection() || |
| 101 | Symbol->getSection().getVariant() == MCSection::SV_COFF) && |
| 102 | "Got non-COFF section in the COFF backend!"); |
| 103 | |
| 104 | MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); |
| 105 | |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 106 | switch (Attribute) { |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 107 | default: return false; |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 108 | case MCSA_WeakReference: |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 109 | case MCSA_Weak: |
| 110 | SD.modifyFlags(COFF::SF_WeakExternal, COFF::SF_WeakExternal); |
| 111 | SD.setExternal(true); |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 112 | break; |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 113 | case MCSA_Global: |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 114 | SD.setExternal(true); |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 115 | break; |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 116 | } |
Saleem Abdulrasool | 4208b61 | 2013-08-09 01:52:03 +0000 | [diff] [blame] | 117 | |
| 118 | return true; |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 119 | } |
| 120 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 121 | void MCWinCOFFStreamer::EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) { |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 122 | llvm_unreachable("not implemented"); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 123 | } |
| 124 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 125 | void MCWinCOFFStreamer::BeginCOFFSymbolDef(MCSymbol const *Symbol) { |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 126 | assert((!Symbol->isInSection() || |
| 127 | Symbol->getSection().getVariant() == MCSection::SV_COFF) && |
| 128 | "Got non-COFF section in the COFF backend!"); |
Saleem Abdulrasool | 6663f8f | 2014-05-22 02:18:10 +0000 | [diff] [blame^] | 129 | |
| 130 | if (CurSymbol) |
| 131 | FatalError("starting a new symbol definition without completing the " |
| 132 | "previous one"); |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 133 | CurSymbol = Symbol; |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 134 | } |
| 135 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 136 | void MCWinCOFFStreamer::EmitCOFFSymbolStorageClass(int StorageClass) { |
Saleem Abdulrasool | 6663f8f | 2014-05-22 02:18:10 +0000 | [diff] [blame^] | 137 | if (!CurSymbol) |
| 138 | FatalError("storage class specified outside of symbol definition"); |
| 139 | |
| 140 | if (StorageClass & ~0xff) |
| 141 | FatalError(Twine("storage class value '") + itostr(StorageClass) + |
| 142 | "' out of range"); |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 143 | |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 144 | MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*CurSymbol); |
| 145 | SD.modifyFlags(StorageClass << COFF::SF_ClassShift, COFF::SF_ClassMask); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 146 | } |
| 147 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 148 | void MCWinCOFFStreamer::EmitCOFFSymbolType(int Type) { |
Saleem Abdulrasool | 6663f8f | 2014-05-22 02:18:10 +0000 | [diff] [blame^] | 149 | if (!CurSymbol) |
| 150 | FatalError("symbol type specified outside of a symbol definition"); |
| 151 | |
| 152 | if (Type & ~0xffff) |
| 153 | FatalError(Twine("type value '") + itostr(Type) + "' out of range"); |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 154 | |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 155 | MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*CurSymbol); |
| 156 | SD.modifyFlags(Type << COFF::SF_TypeShift, COFF::SF_TypeMask); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 159 | void MCWinCOFFStreamer::EndCOFFSymbolDef() { |
Saleem Abdulrasool | 6663f8f | 2014-05-22 02:18:10 +0000 | [diff] [blame^] | 160 | if (!CurSymbol) |
| 161 | FatalError("ending symbol definition without starting one"); |
Craig Topper | bb694de | 2014-04-13 04:57:38 +0000 | [diff] [blame] | 162 | CurSymbol = nullptr; |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 163 | } |
| 164 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 165 | void MCWinCOFFStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) { |
Timur Iskhodzhanov | c1fb2d6 | 2013-12-20 18:15:00 +0000 | [diff] [blame] | 166 | MCDataFragment *DF = getOrCreateDataFragment(); |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 167 | const MCSymbolRefExpr *SRE = MCSymbolRefExpr::Create(Symbol, getContext()); |
| 168 | MCFixup Fixup = MCFixup::Create(DF->getContents().size(), SRE, FK_SecRel_2); |
| 169 | DF->getFixups().push_back(Fixup); |
Timur Iskhodzhanov | c1fb2d6 | 2013-12-20 18:15:00 +0000 | [diff] [blame] | 170 | DF->getContents().resize(DF->getContents().size() + 4, 0); |
| 171 | } |
| 172 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 173 | void MCWinCOFFStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol) { |
Rafael Espindola | d3df3d3 | 2011-12-17 01:14:52 +0000 | [diff] [blame] | 174 | MCDataFragment *DF = getOrCreateDataFragment(); |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 175 | const MCSymbolRefExpr *SRE = MCSymbolRefExpr::Create(Symbol, getContext()); |
| 176 | MCFixup Fixup = MCFixup::Create(DF->getContents().size(), SRE, FK_SecRel_4); |
| 177 | DF->getFixups().push_back(Fixup); |
Rafael Espindola | d3df3d3 | 2011-12-17 01:14:52 +0000 | [diff] [blame] | 178 | DF->getContents().resize(DF->getContents().size() + 4, 0); |
| 179 | } |
| 180 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 181 | void MCWinCOFFStreamer::EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) { |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 182 | llvm_unreachable("not supported"); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 183 | } |
| 184 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 185 | void MCWinCOFFStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, |
| 186 | unsigned ByteAlignment) { |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 187 | assert((!Symbol->isInSection() || |
| 188 | Symbol->getSection().getVariant() == MCSection::SV_COFF) && |
| 189 | "Got non-COFF section in the COFF backend!"); |
David Majnemer | a9bdb32 | 2014-04-08 22:33:40 +0000 | [diff] [blame] | 190 | |
| 191 | if (ByteAlignment > 32) |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 192 | report_fatal_error("alignment is limited to 32-bytes"); |
David Majnemer | a9bdb32 | 2014-04-08 22:33:40 +0000 | [diff] [blame] | 193 | |
Craig Topper | bb694de | 2014-04-13 04:57:38 +0000 | [diff] [blame] | 194 | AssignSection(Symbol, nullptr); |
David Majnemer | a9bdb32 | 2014-04-08 22:33:40 +0000 | [diff] [blame] | 195 | |
| 196 | MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); |
| 197 | SD.setExternal(true); |
| 198 | SD.setCommon(Size, ByteAlignment); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 199 | } |
| 200 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 201 | void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, |
| 202 | unsigned ByteAlignment) { |
David Majnemer | a9bdb32 | 2014-04-08 22:33:40 +0000 | [diff] [blame] | 203 | assert(!Symbol->isInSection() && "Symbol must not already have a section!"); |
| 204 | |
| 205 | const MCSection *Section = getContext().getObjectFileInfo()->getBSSSection(); |
| 206 | MCSectionData &SectionData = getAssembler().getOrCreateSectionData(*Section); |
| 207 | if (SectionData.getAlignment() < ByteAlignment) |
| 208 | SectionData.setAlignment(ByteAlignment); |
| 209 | |
| 210 | MCSymbolData &SD = getAssembler().getOrCreateSymbolData(*Symbol); |
| 211 | SD.setExternal(false); |
| 212 | |
| 213 | AssignSection(Symbol, Section); |
| 214 | |
| 215 | if (ByteAlignment != 1) |
| 216 | new MCAlignFragment(ByteAlignment, /*_Value=*/0, /*_ValueSize=*/0, |
| 217 | ByteAlignment, &SectionData); |
| 218 | |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 219 | MCFillFragment *Fragment = |
| 220 | new MCFillFragment(/*_Value=*/0, /*_ValueSize=*/0, Size, &SectionData); |
| 221 | SD.setFragment(Fragment); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 222 | } |
| 223 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 224 | void MCWinCOFFStreamer::EmitZerofill(const MCSection *Section, |
| 225 | MCSymbol *Symbol, uint64_t Size, |
| 226 | unsigned ByteAlignment) { |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 227 | llvm_unreachable("not implemented"); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 228 | } |
| 229 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 230 | void MCWinCOFFStreamer::EmitTBSSSymbol(const MCSection *Section, |
| 231 | MCSymbol *Symbol, uint64_t Size, |
| 232 | unsigned ByteAlignment) { |
Michael J. Spencer | e2da0a4 | 2010-07-19 06:13:10 +0000 | [diff] [blame] | 233 | llvm_unreachable("not implemented"); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 234 | } |
| 235 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 236 | void MCWinCOFFStreamer::EmitFileDirective(StringRef Filename) { |
Saleem Abdulrasool | a2bf05a | 2014-04-16 04:15:32 +0000 | [diff] [blame] | 237 | getAssembler().addFileName(Filename); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 238 | } |
| 239 | |
Rafael Espindola | 5645bad | 2013-10-16 01:05:45 +0000 | [diff] [blame] | 240 | // TODO: Implement this if you want to emit .comment section in COFF obj files. |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 241 | void MCWinCOFFStreamer::EmitIdent(StringRef IdentString) { |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 242 | llvm_unreachable("not implemented"); |
Rafael Espindola | 5645bad | 2013-10-16 01:05:45 +0000 | [diff] [blame] | 243 | } |
| 244 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 245 | void MCWinCOFFStreamer::EmitWin64EHHandlerData() { |
Saleem Abdulrasool | a8b1f72 | 2014-04-27 03:48:12 +0000 | [diff] [blame] | 246 | llvm_unreachable("not implemented"); |
Charles Davis | 1c8bd5a | 2011-05-22 03:01:05 +0000 | [diff] [blame] | 247 | } |
| 248 | |
Saleem Abdulrasool | cf1a29f | 2014-04-27 03:48:05 +0000 | [diff] [blame] | 249 | void MCWinCOFFStreamer::FinishImpl() { |
Rafael Espindola | 0708209 | 2012-01-07 03:13:18 +0000 | [diff] [blame] | 250 | MCObjectStreamer::FinishImpl(); |
Chris Lattner | 56725be | 2010-07-11 22:05:00 +0000 | [diff] [blame] | 251 | } |
Saleem Abdulrasool | 6663f8f | 2014-05-22 02:18:10 +0000 | [diff] [blame^] | 252 | |
| 253 | LLVM_ATTRIBUTE_NORETURN |
| 254 | void MCWinCOFFStreamer::FatalError(const Twine &Msg) const { |
| 255 | getContext().FatalError(SMLoc(), Msg); |
| 256 | } |
Saleem Abdulrasool | 8e4fee0 | 2014-04-27 03:48:01 +0000 | [diff] [blame] | 257 | } |
| 258 | |