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

John McCall rjmccall at apple.com
Fri Dec 3 11:35:10 PST 2010


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