[LLVMdev] gcroot intrinsic

Nick Lewycky nlewycky at google.com
Wed Jun 8 18:07:18 PDT 2011


On 8 June 2011 17:20, Anderson, Todd A <todd.a.anderson at intel.com> wrote:

> I’ve been tinkering around with some llvm assembly trying out some of the
> GC related features.  When I add a call to @llvm.gcroot, it is consistently
> acting like it doesn’t know what that function is.  I’m just getting started
> so it is probably something small and simple but some googling didn’t yield
> much in the  way of an answer.  Any help is appreciated.
>

Intrinsic functions still need declarations. If you take a look at
http://llvm.org/docs/LangRef.html#int_gcroot and copy the declaration listed
under "syntax" to the top of your .ll file, then it will assemble with
llvm-as.

Nick

****
>
> ** Thanks,
>
> ** **
>
> Todd****
>
> ** **
>
> ----------------------------------------------------****
>
> ** **
>
> llvm-as: test1.s:12:13: error: use of undefined value '@llvm.gcroot'****
>
>   call void @llvm.gcroot(i8** %p, i8* null)****
>
> ** **
>
> define void @foo() gc "tgc" {****
>
>   %p = alloca i8*, align 4****
>
>   %1 = load i8** %p, align 4****
>
>   call void @llvm.gcroot(i8** %p, i8* null)****
>
>   ret void****
>
> }****
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110608/ab776081/attachment.html>


More information about the llvm-dev mailing list