[llvm-commits] [PATCH] Start of support for __attribute__((ms_hook_prologue))

Michael Spencer bigcheesegs at gmail.com
Sun Oct 24 23:16:48 PDT 2010


On Sun, Oct 24, 2010 at 9:43 PM, Charles Davis <cdavis at mymail.mines.edu> wrote:
> Hi,
>
> I thought that, while I wait for a response to my latest clang "patch"
> on cfe-dev, I'd work on something else Wine-related.
>
> Microsoft's compiler has a switch, '/hotpatch', that inserts a magic
> sequence in the beginning of every compiled function. This sequence lets
> other DLLs hook these functions (assuming they were exported from a DLL)
> to do interesting things when they're called. In response, GCC added an
> attribute, 'ms_hook_prologue', that does the same in GCC (partially at
> the behest of the Wine developers). And now I intend to do the same for
> Clang.
>
> Of course, this needs backend support. So, as with my
> 'force_align_arg_pointer' patches, I'm starting with the basics. This
> patch adds support for the attribute in LLVM IR. OK to commit?
>
> Chip

I'm not convinced that a new attribute is needed. We already have
dllexport linkage, so why not just add an option that makes all
dllexport functions hot patchable? It doesn't change the calling
convention at all.

Also, this doesn't seem to include the lexing or parsing code for the keyword.

- Michael Spencer



More information about the llvm-commits mailing list