From d767d4e96e8d664f5e13414822c23b5a977c77fb Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Tue, 23 Feb 2010 18:26:34 +0000 Subject: 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 --- include/llvm/MC/MCStreamer.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/llvm/MC/MCStreamer.h') 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. /// -- cgit v1.1