diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-06-24 19:25:34 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-06-24 19:25:34 +0000 |
commit | f9e2b0c1d06fb8f3619433b9830e9cb9ac38d8d0 (patch) | |
tree | 15243cb6095f4f5eb5c00b47dd28a5a6998f11de /include/llvm | |
parent | 14f791a5d50335f90bd0e57b5c3b45fdd84216d9 (diff) | |
download | external_llvm-f9e2b0c1d06fb8f3619433b9830e9cb9ac38d8d0.zip external_llvm-f9e2b0c1d06fb8f3619433b9830e9cb9ac38d8d0.tar.gz external_llvm-f9e2b0c1d06fb8f3619433b9830e9cb9ac38d8d0.tar.bz2 |
Sketch streamer support for .align, .org functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 0ce8113..bb85d2d 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -10,6 +10,8 @@ #ifndef LLVM_MC_MCSTREAMER_H #define LLVM_MC_MCSTREAMER_H +#include "llvm/Support/DataTypes.h" + namespace llvm { class MCContext; class MCValue; @@ -53,6 +55,9 @@ namespace llvm { MCContext &getContext() const { return Context; } + /// @name Symbol & Section Management + /// @{ + /// SwitchSection - Set the current section where code is being emitted to /// @param Section. /// @@ -98,6 +103,10 @@ namespace llvm { virtual void EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) = 0; + /// @} + /// @name Generating Data + /// @{ + /// EmitBytes - Emit @param Length bytes starting at @param Data into the /// output. /// @@ -116,6 +125,42 @@ namespace llvm { /// match a native machine width. virtual void EmitValue(const MCValue &Value, unsigned Size) = 0; + /// EmitValueToAlignment - Emit some number of copies of @param Value until + /// the byte alignment @param ByteAlignment is reached. + /// + /// If the number of bytes need to emit for the alignment is not a multiple + /// of @param ValueSize, then the contents of the emitted fill bytes is + /// undefined. + /// + /// This used to implement the .align assembler directive. + /// + /// @param ByteAlignment - The alignment to reach. This must be a power of + /// two. + /// @param Value - The value to use when filling bytes. + /// @param Size - The size of the integer (in bytes) to emit for @param + /// Value. This must match a native machine width. + /// @param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If + /// the alignment cannot be reached in this many bytes, no bytes are + /// emitted. + virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0, + unsigned ValueSize = 1, + unsigned MaxBytesToEmit = 0) = 0; + + /// EmitValueToOffset - Emit some number of copies of @param Value until the + /// byte offset @param Offset is reached. + /// + /// This is used to implement assembler directives such as .org. + /// + /// @param Offset - The offset to reach.This may be an expression, but the + /// expression must be associated with the current section. + /// @param Value - The value to use when filling bytes. + // + // FIXME: How are we going to signal failures out of this? + virtual void EmitValueToOffset(const MCValue &Offset, + unsigned char Value = 0) = 0; + + /// @} + /// EmitInstruction - Emit the given @param Instruction into the current /// section. virtual void EmitInstruction(const MCInst &Inst) = 0; |