[cfe-dev] Strange character around function declared with "asm"

Lorenzo De Carli lorenzo at cs.wisc.edu
Mon Dec 6 08:34:29 PST 2010


John,

This may be a solution, but I feel it is somewhat limited. If someone
could point me to the portion of code that generates the operands for
call, I could do a quick hack to avoid prefixing symbols when they
start with "llvm." (as it is probably done in llvm.gcc). I acknowledge
that it is a ugly hack, but as I said it would be good enough for my
purpose (and I would not submit it upstream anyway).

Thanks,
Lorenzo


On Fri, Dec 3, 2010 at 1:35 PM, John McCall <rjmccall at apple.com> wrote:
> On Dec 3, 2010, at 11:25 AM, Lorenzo De Carli wrote:
>> Uhm... what do you mean? Post-processing the IR code with an external
>> script? I personally think it would be a much cleaner solution to
>> generate the intrinsics within CLANG. I googled for a while but the
>> only thing I found was the "asm" solution, which as I said seems to
>> work in llvm-gcc but not in CLANG. So I was wondering if there is an
>> alternative way which does not involves going outside CLANG/LLVM.
>
> Well, I assume by "intrinsic" you mean that you can't actually *run* compiled
> code containing these calls without further processing, because these functions
> don't actually exist in your runtime.  So somewhere downstream you're going
> to examine or modify the IR, and in that case, there's no reason that code can't
> look for a function called "LorenzosMagicFunction" instead of a function called
> "llvm.lorenzos.magic.function".  There's no rule saying that special functions
> have to have names starting with "llvm.";  the existing intrinsics are only special
> because some code somewhere knows to look for functions with those names.
>
> John.




More information about the cfe-dev mailing list