diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-04-03 03:56:52 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-04-03 03:56:52 +0000 |
commit | 90e7d4f6f006672a59ff8e031a190c76f9dab4b3 (patch) | |
tree | 1e67cd7b0f941423ee39e35efa46b61c9a300ae9 /tools/lto | |
parent | cbece8c2a6c06b3c14e35228b326e629f936c458 (diff) | |
download | external_llvm-90e7d4f6f006672a59ff8e031a190c76f9dab4b3.zip external_llvm-90e7d4f6f006672a59ff8e031a190c76f9dab4b3.tar.gz external_llvm-90e7d4f6f006672a59ff8e031a190c76f9dab4b3.tar.bz2 |
Reformatting. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/LTOModule.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index 963bb53..1dbd64b 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -491,7 +491,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue *decl, bool isFunc) { namespace { class RecordStreamer : public MCStreamer { public: - enum State { NeverSeen, Global, Defined, DefinedGlobal, Used}; + enum State { NeverSeen, Global, Defined, DefinedGlobal, Used }; private: StringMap<State> Symbols; @@ -580,14 +580,16 @@ namespace { RecordStreamer(MCContext &Context) : MCStreamer(Context) {} - virtual void ChangeSection(const MCSection *Section) {} - virtual void InitSections() {} + virtual void EmitInstruction(const MCInst &Inst) { + // Scan for values. + for (unsigned i = Inst.getNumOperands(); i--; ) + if (Inst.getOperand(i).isExpr()) + AddValueSymbols(Inst.getOperand(i).getExpr()); + } virtual void EmitLabel(MCSymbol *Symbol) { Symbol->setSection(*getCurrentSection()); markDefined(*Symbol); } - virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {} - virtual void EmitThumbFunc(MCSymbol *Func) {} virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) { // FIXME: should we handle aliases? markDefined(*Symbol); @@ -596,20 +598,26 @@ namespace { if (Attribute == MCSA_Global) markGlobal(*Symbol); } - virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {} - virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {} - virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {} - virtual void EmitCOFFSymbolStorageClass(int StorageClass) {} virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol, unsigned Size , unsigned ByteAlignment) { markDefined(*Symbol); } - virtual void EmitCOFFSymbolType(int Type) {} - virtual void EndCOFFSymbolDef() {} virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) { markDefined(*Symbol); } + + // Noop calls. + virtual void ChangeSection(const MCSection *Section) {} + virtual void InitSections() {} + virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {} + virtual void EmitThumbFunc(MCSymbol *Func) {} + virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {} + virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) {} + virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {} + virtual void EmitCOFFSymbolStorageClass(int StorageClass) {} + virtual void EmitCOFFSymbolType(int Type) {} + virtual void EndCOFFSymbolDef() {} virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {} virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) {} @@ -632,13 +640,6 @@ namespace { const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize) {} - - virtual void EmitInstruction(const MCInst &Inst) { - // Scan for values. - for (unsigned i = Inst.getNumOperands(); i--; ) - if (Inst.getOperand(i).isExpr()) - AddValueSymbols(Inst.getOperand(i).getExpr()); - } virtual void FinishImpl() {} }; } // end anonymous namespace |