| OLD | NEW |
| 1 //===- lib/MC/MCObjectStreamer.cpp - Object File MCStreamer Interface -----===// | 1 //===- lib/MC/MCObjectStreamer.cpp - Object File MCStreamer Interface -----===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 | 9 |
| 10 #include "llvm/MC/MCObjectStreamer.h" | 10 #include "llvm/MC/MCObjectStreamer.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 void MCObjectStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { | 207 void MCObjectStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { |
| 208 getAssembler().getOrCreateSymbolData(*Symbol); | 208 getAssembler().getOrCreateSymbolData(*Symbol); |
| 209 MCStreamer::EmitAssignment(Symbol, Value); | 209 MCStreamer::EmitAssignment(Symbol, Value); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void MCObjectStreamer::EmitInstruction(const MCInst &Inst, | 212 void MCObjectStreamer::EmitInstruction(const MCInst &Inst, |
| 213 const MCSubtargetInfo &STI) { | 213 const MCSubtargetInfo &STI) { |
| 214 | 214 |
| 215 // @LOCALMOD-START | 215 // @LOCALMOD-START |
| 216 if (NaClExpander && NaClExpander->expandInst(Inst, *this, STI)) | 216 MCSectionData *SD = getCurrentSectionData(); |
| 217 if (!SD->isBundleLocked() && NaClExpander && NaClExpander->expandInst(Inst, *t
his, STI)) |
| 217 return; | 218 return; |
| 218 | 219 |
| 219 if (getAssembler().isBundlingEnabled() && | 220 if (getAssembler().isBundlingEnabled() && |
| 220 getAssembler().getBackend().CustomExpandInst(Inst, *this)) { | 221 getAssembler().getBackend().CustomExpandInst(Inst, *this)) { |
| 221 return; | 222 return; |
| 222 } | 223 } |
| 223 // @LOCALMOD-END | 224 // @LOCALMOD-END |
| 224 | 225 |
| 225 MCStreamer::EmitInstruction(Inst, STI); | 226 MCStreamer::EmitInstruction(Inst, STI); |
| 226 | 227 |
| 227 MCSectionData *SD = getCurrentSectionData(); | 228 |
| 228 SD->setHasInstructions(true); | 229 SD->setHasInstructions(true); |
| 229 | 230 |
| 230 // Now that a machine instruction has been assembled into this section, make | 231 // Now that a machine instruction has been assembled into this section, make |
| 231 // a line entry for any .loc directive that has been seen. | 232 // a line entry for any .loc directive that has been seen. |
| 232 MCLineEntry::Make(this, getCurrentSection().first); | 233 MCLineEntry::Make(this, getCurrentSection().first); |
| 233 | 234 |
| 234 // If this instruction doesn't need relaxation, just emit it as data. | 235 // If this instruction doesn't need relaxation, just emit it as data. |
| 235 MCAssembler &Assembler = getAssembler(); | 236 MCAssembler &Assembler = getAssembler(); |
| 236 if (!Assembler.getBackend().mayNeedRelaxation(Inst)) { | 237 if (!Assembler.getBackend().mayNeedRelaxation(Inst)) { |
| 237 EmitInstToData(Inst, STI); | 238 EmitInstToData(Inst, STI); |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 // If we are generating dwarf for assembly source files dump out the sections. | 444 // If we are generating dwarf for assembly source files dump out the sections. |
| 444 if (getContext().getGenDwarfForAssembly()) | 445 if (getContext().getGenDwarfForAssembly()) |
| 445 MCGenDwarfInfo::Emit(this); | 446 MCGenDwarfInfo::Emit(this); |
| 446 | 447 |
| 447 // Dump out the dwarf file & directory tables and line tables. | 448 // Dump out the dwarf file & directory tables and line tables. |
| 448 MCDwarfLineTable::Emit(this); | 449 MCDwarfLineTable::Emit(this); |
| 449 | 450 |
| 450 flushPendingLabels(nullptr); | 451 flushPendingLabels(nullptr); |
| 451 getAssembler().Finish(); | 452 getAssembler().Finish(); |
| 452 } | 453 } |
| OLD | NEW |