[LLVMdev] [PATCH] Symbol offsets
Gabor Greif
ggreif at gmail.com
Wed May 28 03:23:15 PDT 2014
Quoting Peter:
> Before, when I was thinking about calls to functions with prefix data in
> cases where the function entry point appears after the data (i.e. GHC's use
> case), I was imagining that we could have two new properties for functions:
> the symbol offset and the entry point offset. UBSan etc would set both to
> zero, while GHC would set the former to zero and the latter to the size of
> the prefix.
Agree, but let me voice a heretic opinion: maybe those annotations
should not go on functions but on basic blocks! After all they make
little sense when a function has no entry block. Also in presence of
computed gotos this type of prologue and metadata on blocks would be
very interesting to have. I'm thinking of multiple-return points (akin
to exceptions, but lighter weight). I have no proposal to make, just
thinking out loud.
Cheers,
Gabor
>
> Provided that we need to cater to platforms where the function's metadata
> cannot appear before the function's symbol (which I believe to be the case
> on at least Darwin) we need some way of representing the distance between
> the symbol and the entry point in external function declarations. Under your
> proposal, we could probably do that by having a way of representing the type
> of the prefix separately from its "initializer".
More information about the llvm-dev
mailing list