diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-04-03 21:35:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-04-03 21:35:55 +0000 |
| commit | 91bead790518fcf5cb26019fb1ebf2372e8a5b3f (patch) | |
| tree | 069591723216e18906bac6c3117502c73a56bf0b /include | |
| parent | 47b7e5dae911bc98aa76fa5d2ee506c9304f941a (diff) | |
add a new EmitInlineAsm function to asmprinter to handle inline asm.
If we have an MCAsmStreamer, we continue to emit asm textually,
otherwise we (currently) emit an error to errs and ignore it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 5 | ||||
| -rw-r--r-- | include/llvm/MC/MCStreamer.h | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index a405932bea..51f55109c9 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -354,9 +354,12 @@ namespace llvm { /// isBlockOnlyReachableByFallthough - Return true if the basic block has /// exactly one predecessor and the control transfer mechanism between /// the predecessor and this block is a fall-through. - virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const; + virtual bool + isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const; private: + /// EmitInlineAsm - Emit a blob of inline asm to the output streamer. + void EmitInlineAsm(StringRef Str); /// processDebugLoc - Processes the debug information of each machine /// instruction's DebugLoc. diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index bdcfdb2deb..d42342c145 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -62,9 +62,13 @@ class TargetAsmBackend; /// @name Assembly File Formatting. /// @{ - /// isVerboseAsm - Return true if this streamer supports verbose assembly at - /// all. + /// isVerboseAsm - Return true if this streamer supports verbose assembly + /// and if it is enabled. virtual bool isVerboseAsm() const { return false; } + + /// hasRawTextSupport - Return true if this asm streamer supports emitting + /// unformatted text to the .s file with EmitRawText. + virtual bool hasRawTextSupport() const { return false; } /// AddComment - Add a comment that can be emitted to the generated .s /// file if applicable as a QoI issue to make the output of the compiler @@ -278,6 +282,11 @@ class TargetAsmBackend; /// section. virtual void EmitInstruction(const MCInst &Inst) = 0; + /// EmitRawText - If this file is backed by a assembly streamer, this dumps + /// the specified string in the output .s file. This capability is + /// indicated by the hasRawTextSupport() predicate. By default this aborts. + virtual void EmitRawText(StringRef String); + /// Finish - Finish emission of machine code and flush any output. virtual void Finish() = 0; }; |
