diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 15:47:54 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 15:47:54 +0000 |
commit | b0d78d0192c66f71ae71dbb7c655a31b29360717 (patch) | |
tree | 21f8808a2ac13361b6cb4bc9a4d8b98833ddfe7a /include/llvm | |
parent | 98fd6f18aae75bfea7360503a4cf8d1af3e7fad1 (diff) | |
download | llvm-b0d78d0192c66f71ae71dbb7c655a31b29360717.tar.gz llvm-b0d78d0192c66f71ae71dbb7c655a31b29360717.tar.bz2 llvm-b0d78d0192c66f71ae71dbb7c655a31b29360717.tar.xz |
Move emitInlineAsmEnd to the AsmPrinter interface.
There is no inline asm in a .s file. Therefore, there should be no logic to
handle it in the streamer. Inline asm only exists in bitcode files, so the
logic can live in the (long misnamed) AsmPrinter class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 10 | ||||
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 21 |
2 files changed, 10 insertions, 21 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index c22d1ea306..85f4130a2f 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -45,6 +45,7 @@ namespace llvm { class MCInstrInfo; class MCSection; class MCStreamer; + class MCSubtargetInfo; class MCSymbol; class MDNode; class DwarfDebug; @@ -461,6 +462,15 @@ namespace llvm { unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS); + /// Let the target do anything it needs to do after emitting inlineasm. + /// This callback can be used restore the original mode in case the + /// inlineasm contains directives to switch modes. + /// \p StartInfo - the original subtarget info before inline asm + /// \p EndInfo - the final subtarget info after parsing the inline asm, + /// or NULL if the value is unknown. + virtual void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo, + MCSubtargetInfo *EndInfo) const; + private: /// Private state for PrintSpecial() // Assign a unique ID to this machine instruction. diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 1538a41149..eb68be77c2 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -75,15 +75,6 @@ public: // Allow a target to add behavior to the EmitLabel of MCStreamer. virtual void emitLabel(MCSymbol *Symbol); - - /// Let the target do anything it needs to do after emitting inlineasm. - /// This callback can be used restore the original mode in case the - /// inlineasm contains directives to switch modes. - /// \p StartInfo - the original subtarget info before inline asm - /// \p EndInfo - the final subtarget info after parsing the inline asm, - // or NULL if the value is unknown. - virtual void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo, - MCSubtargetInfo *EndInfo) {} }; // FIXME: declared here because it is used from @@ -114,8 +105,6 @@ public: virtual void emitArch(unsigned Arch) = 0; virtual void finishAttributeSection() = 0; virtual void emitInst(uint32_t Inst, char Suffix = '\0') = 0; - virtual void emitInlineAsmEnd(const MCSubtargetInfo &StartInfo, - MCSubtargetInfo *EndInfo); }; /// MCStreamer - Streaming machine code generation interface. This interface @@ -689,16 +678,6 @@ public: /// indicated by the hasRawTextSupport() predicate. By default this aborts. void EmitRawText(const Twine &String); - /// EmitInlineAsmEnd - Used to perform any cleanup needed after emitting - /// inline assembly. Provides the start and end subtarget info values. - /// The end subtarget info may be NULL if it is not know, for example, when - /// emitting the inline assembly as raw text. - virtual void EmitInlineAsmEnd(const MCSubtargetInfo &StartInfo, - MCSubtargetInfo *EndInfo) { - if (TargetStreamer) - TargetStreamer->emitInlineAsmEnd(StartInfo, EndInfo); - } - /// Flush - Causes any cached state to be written out. virtual void Flush() {} |