LLVM  3.7.0
RecordStreamer.h
Go to the documentation of this file.
1 //===-- RecordStreamer.h - Record asm defined and used symbols ---*- 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 
10 #ifndef LLVM_LIB_OBJECT_RECORDSTREAMER_H
11 #define LLVM_LIB_OBJECT_RECORDSTREAMER_H
12 
13 #include "llvm/MC/MCStreamer.h"
14 
15 namespace llvm {
16 class RecordStreamer : public MCStreamer {
17 public:
19 
20 private:
21  StringMap<State> Symbols;
22  void markDefined(const MCSymbol &Symbol);
23  void markGlobal(const MCSymbol &Symbol);
24  void markUsed(const MCSymbol &Symbol);
25  void visitUsedSymbol(const MCSymbol &Sym) override;
26 
27 public:
31  RecordStreamer(MCContext &Context);
32  void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
33  void EmitLabel(MCSymbol *Symbol) override;
34  void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
36  void EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
37  unsigned ByteAlignment) override;
38  void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
39  unsigned ByteAlignment) override;
40 };
41 }
42 #endif
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
void EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit the zerofill section and an optional symbol.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
const_iterator end()
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:33
Context object for machine code objects.
Definition: MCContext.h:48
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
Streaming machine code generation interface.
Definition: MCStreamer.h:157
RecordStreamer(MCContext &Context)
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
MCSymbolAttr
Definition: MCDirectives.h:19
StringMap< State >::const_iterator const_iterator
MCSubtargetInfo - Generic base class for all target subtargets.
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
void EmitLabel(MCSymbol *Symbol) override
Emit a label for Symbol into the current section.
LLVM Value Representation.
Definition: Value.h:69
const_iterator begin()