[LLVMdev] Question about Doc patch

Gordon Henriksen gordonhenriksen at mac.com
Fri Apr 25 11:43:31 PDT 2008


On Apr 25, 2008, at 14:32, Terence Parr wrote:

> Howdy. I submitted a number of documentation patches to Chris, but  
> he wanted your input on this one:
>
>>> Also, is this correct:
>>>
>>> %class.Array = type { %class.Object, i32, [0 x %class.Object*] }
>>> ?  Wondering if it should be
>>> %class.Array = type { %class.Object*, i32, [0 x %class.Object*] }
>>
>> Not sure about this, please ask Gordon.
>
> Now I can't remember where that is even, but it must be in the  
> garbage collection doc.

It is correct as written. The idiomatic way to implement B inherits A  
in LLVM is

%B = type { %A, ... }

> Also:
>
>>> Can't get GC instruction to get thru llvm-as yet so I can't answer  
>>> for myself ;)  Ack, took me an hour to figure out that an  
>>> *intrinsic* needs a manual decl:
>>> declare void @llvm.gcroot(i8 **, i8*)
>>> Could you add that to the GC doc?  just adding to code sample  
>>> would help a lot.  Not sure which is correct so I can't add (% or @)
>
> I'd like to propose a patch to the documentation in the gcroot  
> instruction area(s) that puts this
>
>>> declare void @llvm.gcroot(i8 **, i8*)
>
> in at least one of the examples. took me awhile to figure out I  
> needed to declare that as a function. The term intrinsic made me  
> think it was a built-in instruction.

Probably best would be to state that clearly in http://llvm.org/docs/LangRef.html#intrinsics 
  and hyperlink the first instance of 'intrinsic' (within each  
section?) of GarbageCollection.html. Possibly add the terms 'declare'  
to each of the intrinsics documented at http://llvm.org/docs/GarbageCollection.html#core 
.

— Gordon





More information about the llvm-dev mailing list