X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FMC%2FMCStreamer.h;h=fb94f9d5ffee98e64dc0fef9358d9634b7f251c0;hb=3c733ea0649665b81947de596d410a5c4f42f5f4;hp=04af407a445e3535f2bd0f36b7d99a1906b1465e;hpb=23125d02d929758e1b0dbb30b13f1deff7a5ea4b;p=oota-llvm.git diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 04af407a445..fb94f9d5ffe 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -71,11 +71,15 @@ protected: public: virtual ~MCTargetStreamer(); void setStreamer(MCStreamer *S) { Streamer = S; } + + // Allow a target to add behavior to the EmitLabel of MCStreamer. + virtual void emitLabel(MCSymbol *Symbol); }; // FIXME: declared here because it is used from // lib/CodeGen/AsmPrinter/ARMException.cpp. class ARMTargetStreamer : public MCTargetStreamer { + virtual void anchor(); public: virtual void emitFnStart() = 0; virtual void emitFnEnd() = 0; @@ -91,8 +95,12 @@ public: virtual void switchVendor(StringRef Vendor) = 0; virtual void emitAttribute(unsigned Attribute, unsigned Value) = 0; virtual void emitTextAttribute(unsigned Attribute, StringRef String) = 0; + virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue, + StringRef StringValue = "") = 0; virtual void emitFPU(unsigned FPU) = 0; + virtual void emitArch(unsigned Arch) = 0; virtual void finishAttributeSection() = 0; + virtual void emitInst(uint32_t Inst, char Suffix = '\0') = 0; }; /// MCStreamer - Streaming machine code generation interface. This interface @@ -166,9 +174,8 @@ public: MCContext &getContext() const { return Context; } - MCTargetStreamer &getTargetStreamer() { - assert(TargetStreamer); - return *TargetStreamer; + MCTargetStreamer *getTargetStreamer() { + return TargetStreamer.get(); } unsigned getNumFrameInfos() { return FrameInfos.size(); } @@ -333,6 +340,8 @@ public: /// @param Symbol - The symbol to emit. A given symbol should only be /// emitted as a label once, and symbols emitted as a label should never be /// used in an assignment. + // FIXME: These emission are non-const because we mutate the symbol to + // add the section we're emitting it to later. virtual void EmitLabel(MCSymbol *Symbol); virtual void EmitDebugLabel(MCSymbol *Symbol); @@ -406,9 +415,14 @@ public: /// EndCOFFSymbolDef - Marks the end of the symbol definition. virtual void EndCOFFSymbolDef() = 0; + /// EmitCOFFSectionIndex - Emits a COFF section index. + /// + /// @param Symbol - Symbol the section number relocation should point to. + virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol); + /// EmitCOFFSecRel32 - Emits a COFF section relative relocation. /// - /// @param Symbol - Symbol the section relative realocation should point to. + /// @param Symbol - Symbol the section relative relocation should point to. virtual void EmitCOFFSecRel32(MCSymbol const *Symbol); /// EmitELFSize - Emit an ELF .size directive.