comparison lib/Object/RecordStreamer.cpp @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents 1172e4bd9c6f
children
comparison
equal deleted inserted replaced
120:1172e4bd9c6f 121:803732b1fca8
1 //===-- RecordStreamer.cpp - Record asm definde and used symbols ----------===// 1 //===-- RecordStreamer.cpp - Record asm defined and used symbols ----------===//
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 "RecordStreamer.h" 10 #include "RecordStreamer.h"
11 #include "llvm/MC/MCSymbol.h" 11 #include "llvm/MC/MCSymbol.h"
12
12 using namespace llvm; 13 using namespace llvm;
13 14
14 void RecordStreamer::markDefined(const MCSymbol &Symbol) { 15 void RecordStreamer::markDefined(const MCSymbol &Symbol) {
15 State &S = Symbols[Symbol.getName()]; 16 State &S = Symbols[Symbol.getName()];
16 switch (S) { 17 switch (S) {
67 } 68 }
68 } 69 }
69 70
70 void RecordStreamer::visitUsedSymbol(const MCSymbol &Sym) { markUsed(Sym); } 71 void RecordStreamer::visitUsedSymbol(const MCSymbol &Sym) { markUsed(Sym); }
71 72
73 RecordStreamer::RecordStreamer(MCContext &Context) : MCStreamer(Context) {}
74
72 RecordStreamer::const_iterator RecordStreamer::begin() { 75 RecordStreamer::const_iterator RecordStreamer::begin() {
73 return Symbols.begin(); 76 return Symbols.begin();
74 } 77 }
75 78
76 RecordStreamer::const_iterator RecordStreamer::end() { return Symbols.end(); } 79 RecordStreamer::const_iterator RecordStreamer::end() { return Symbols.end(); }
77 80
78 RecordStreamer::RecordStreamer(MCContext &Context) : MCStreamer(Context) {}
79
80 void RecordStreamer::EmitInstruction(const MCInst &Inst, 81 void RecordStreamer::EmitInstruction(const MCInst &Inst,
81 const MCSubtargetInfo &STI) { 82 const MCSubtargetInfo &STI, bool) {
82 MCStreamer::EmitInstruction(Inst, STI); 83 MCStreamer::EmitInstruction(Inst, STI);
83 } 84 }
84 85
85 void RecordStreamer::EmitLabel(MCSymbol *Symbol) { 86 void RecordStreamer::EmitLabel(MCSymbol *Symbol, SMLoc Loc) {
86 MCStreamer::EmitLabel(Symbol); 87 MCStreamer::EmitLabel(Symbol);
87 markDefined(*Symbol); 88 markDefined(*Symbol);
88 } 89 }
89 90
90 void RecordStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { 91 void RecordStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
108 109
109 void RecordStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, 110 void RecordStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
110 unsigned ByteAlignment) { 111 unsigned ByteAlignment) {
111 markDefined(*Symbol); 112 markDefined(*Symbol);
112 } 113 }
114
115 void RecordStreamer::emitELFSymverDirective(MCSymbol *Alias,
116 const MCSymbol *Aliasee) {
117 SymverAliasMap[Aliasee].push_back(Alias);
118 }