[LLVMdev] Code documentation

Chris Lattner sabre at nondot.org
Thu Apr 8 09:17:04 PDT 2004


On Thu, 8 Apr 2004, Vladimir Prus wrote:
> is there any documentation for LLVM codebase other than produced by doxygen?

Yes, most definitely:
http://llvm.cs.uiuc.edu/Documentation.html

> The reason I'm asking is that doxygen docs are
> (1) not very complete at the moment, as lot of classes don't even have a
> description
> (2) is generally not the best way to get high-level view of a big codebase.

Quite true.  Note that, in general, there are reasonable comments and
descriptions of each interface at the top of each header file.  I don't
think that doxygen picks these descriptions up, so it might be good to
look there.  For example, contrast this:
http://llvm.cs.uiuc.edu/doxygen/LoopInfo_8h-source.html
 to this:
http://llvm.cs.uiuc.edu/doxygen/classllvm_1_1Loop.html

> As an example, consider this code:
>
>      %tmp.1 = setgt int %i, 0
>      br bool %tmp.1, label %then.0, label %else.0
>
> It appears that Value* that corresponds to the %tmp.1 operand of the second
> instruction is actually a pointer to Instruction* which represents the first
> instruction.

This is exactly right.

> This looks a nice design, given that all code is in SSA, but I've spend
> considerable time today before understanding it, because I first tried to
> look up a  ways to find the instruction which defines tmp.1, then looked for
> a method which returns destination of an instruction, and so on..

This should be described in the developer's guide:
http://llvm.cs.uiuc.edu/docs/ProgrammersManual.html#iterate_chains

Like all documentation, it can probably be improved.  If you would like to
contribute a paragraph or two describing what you've learned, we would
love to include it in the manual for others to learn from. :)

> I realize all the developers must be busy, but some overview would be really
> good.

Sure, we think that documentation is really important.  If you have any
questions that are not covered in the documentation, please feel free to
ask on the list.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list