diff options
author | Kevin Enderby <enderby@apple.com> | 2010-02-23 18:26:34 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2010-02-23 18:26:34 +0000 |
commit | d767d4e96e8d664f5e13414822c23b5a977c77fb (patch) | |
tree | 00c107b21ab078d0f18c75447a14577af7de4cb4 /include/llvm/MC/MCStreamer.h | |
parent | 4a9c23db9acaa1afd8d939b892d2a3decebacfeb (diff) | |
download | external_llvm-d767d4e96e8d664f5e13414822c23b5a977c77fb.zip external_llvm-d767d4e96e8d664f5e13414822c23b5a977c77fb.tar.gz external_llvm-d767d4e96e8d664f5e13414822c23b5a977c77fb.tar.bz2 |
This is the first patch to put the needed bits in place to eventually allow code
to be aligned with optimal nops. This patch does not change any functionality
and when the compiler is changed to use EmitCodeAlignment() it should also not
change the resulting output. Once the compiler change is made and everything
looks good the next patch with the table of optimal X86 nops will be added to
WriteNopData() changing the output. There are many FIXMEs in this patch which
will be removed when we have better target hooks (coming soon I hear).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96963 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCStreamer.h')
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index b104b9a..696d024 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -232,6 +232,20 @@ namespace llvm { unsigned ValueSize = 1, unsigned MaxBytesToEmit = 0) = 0; + /// EmitCodeAlignment - Emit nops until the byte alignment @p ByteAlignment + /// is reached. + /// + /// This used to align code where the alignment bytes may be executed. This + /// can emit different bytes for different sizes to optimize execution. + /// + /// @param ByteAlignment - The alignment to reach. This must be a power of + /// two on some targets. + /// @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 EmitCodeAlignment(unsigned ByteAlignment, + unsigned MaxBytesToEmit = 0) = 0; + /// EmitValueToOffset - Emit some number of copies of @p Value until the /// byte offset @p Offset is reached. /// |