llvm.org GIT mirror llvm / 90e7d4f
Reformatting. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153928 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 8 years ago
1 changed file(s) with 21 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
490490 namespace {
491491 class RecordStreamer : public MCStreamer {
492492 public:
493 enum State { NeverSeen, Global, Defined, DefinedGlobal, Used};
493 enum State { NeverSeen, Global, Defined, DefinedGlobal, Used };
494494
495495 private:
496496 StringMap Symbols;
579579
580580 RecordStreamer(MCContext &Context) : MCStreamer(Context) {}
581581
582 virtual void ChangeSection(const MCSection *Section) {}
583 virtual void InitSections() {}
582 virtual void EmitInstruction(const MCInst &Inst) {
583 // Scan for values.
584 for (unsigned i = Inst.getNumOperands(); i--; )
585 if (Inst.getOperand(i).isExpr())
586 AddValueSymbols(Inst.getOperand(i).getExpr());
587 }
584588 virtual void EmitLabel(MCSymbol *Symbol) {
585589 Symbol->setSection(*getCurrentSection());
586590 markDefined(*Symbol);
587591 }
588 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
589 virtual void EmitThumbFunc(MCSymbol *Func) {}
590592 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
591593 // FIXME: should we handle aliases?
592594 markDefined(*Symbol);
595597 if (Attribute == MCSA_Global)
596598 markGlobal(*Symbol);
597599 }
600 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
601 unsigned Size , unsigned ByteAlignment) {
602 markDefined(*Symbol);
603 }
604 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
605 unsigned ByteAlignment) {
606 markDefined(*Symbol);
607 }
608
609 // Noop calls.
610 virtual void ChangeSection(const MCSection *Section) {}
611 virtual void InitSections() {}
612 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
613 virtual void EmitThumbFunc(MCSymbol *Func) {}
598614 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
599615 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {}
600616 virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {}
601617 virtual void EmitCOFFSymbolStorageClass(int StorageClass) {}
602 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
603 unsigned Size , unsigned ByteAlignment) {
604 markDefined(*Symbol);
605 }
606618 virtual void EmitCOFFSymbolType(int Type) {}
607619 virtual void EndCOFFSymbolDef() {}
608 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
609 unsigned ByteAlignment) {
610 markDefined(*Symbol);
611 }
612620 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
613621 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
614622 unsigned ByteAlignment) {}
631639 const MCSymbol *LastLabel,
632640 const MCSymbol *Label,
633641 unsigned PointerSize) {}
634
635 virtual void EmitInstruction(const MCInst &Inst) {
636 // Scan for values.
637 for (unsigned i = Inst.getNumOperands(); i--; )
638 if (Inst.getOperand(i).isExpr())
639 AddValueSymbols(Inst.getOperand(i).getExpr());
640 }
641642 virtual void FinishImpl() {}
642643 };
643644 } // end anonymous namespace