Do you use UML utility programs?

Hello list,

I'd like to know if people use UML tool to analyze and/or document LLVM/Clang.

I use StarUML. It's free and very good though it's free.
But I consider using a commercial program. Because the organization I
belong is willing to support for this.

I don't think I will use these tools to write code.
I think I will use these to do a documentation and analyze code.
So the diagram generation feature is a must. But code generation
feature is not needed much.

Do you use one of these tools? If so let me know your experience.
And I don't believe people use these to generate code for LLVM/Clang.
But it you do, I really like to know about you experience.

Also I'd like to listen your recommendation for a certain product to
buy for my purpose.

I hope this talk doesn't violate the subject of this mail-list.

Best regards

I personally don't use any tool like that.

My impression is that most developers here do not use any kind of UML
code generation; I could, of course, be wrong.

-- Sean Silva

Hi Sean Silva,

Maybe I am the only one who is trying to use UML.
In my team, I am also the only one who draws UML diagrams.

I expected there be someone who use UML like me.
But it's maybe not as your opinion.
Maybe doxygen is enough for majority of people.

Thanks for your reply.

Sincerely
Journeyer J. Joh

UML diagrams can be really helpful for explaining how a piece of code
works (such as the diagrams in your klang project on github).

The main reason I don't draw them is that I haven't found convenient
tools to use which integrate well with my workflow. Doxygen produces
class diagrams, but I would really like to have something which
produces sequence diagrams (such as
<http://journeyer.github.com/klang/sequence_diagram_llvm.html>). What
tools did you use to generate the diagrams for the klang
documentation?

-- Sean Silva

At the bottom

  Created using<a href="http://sphinx.pocoo.org/ <view-source:http://sphinx.pocoo.org/>">Sphinx</a> 1.1.3.

That is the documentation generator which creates generate the HTML
page from the .rst files (similar to how LLVM and Clang's `docs/*.rst`
files get turned into `{,clang.}llvm.org/docs/*.html`), and is not
related to the sequence diagrams (which are just images as far as
Sphinx is concerned). (As it happens, I'm actually the one that set up
the Sphinx infrastructure for klang (see
<https://github.com/Journeyer/klang/pull/2>)).

-- Sean Silva

Hi Sean Silva and people on our list,

What tools did you use to generate the diagrams for the klang documentation?

I use StarUML. ( http://staruml.sourceforge.net/en/ )

I mentioned about this earlier before on this mail-list.
It's a Windows only application and free software.

It is good SW. But development is stopped since long ago.
The product was originally a commercial one. But all of a sudden the
company has been shutdown and the product is released as a free and
open source.

Please don't get me wrong I am not related with this SW.
I am only a user.

Sincerely
Journeyer

Hi Sean Silva,

There is a tool, which can be integrated into doxygen and can generate
sequence diagram.

http://www.gooli.org/blog/doxygen-meets-sequence-diagrams/

I was recommended using this program earlier but haven't tried this yet.
I just want to let you know about this.

Please don't blame me if this consumed your time without successful return. ^^;

I think sequence diagram provides an insight to the readers but
requires too much time for the person who draws it.

Sincerely
Journeyer

do you know that doxygen have a @msc and @mscfile commands?
they are exactly for rendering message sequences...
http://www.stack.nl/~dimitri/doxygen/commands.html#cmdmsc

but you have to draw a diagram using language similar to graphviz dot.

Didn't know about that. However, I was thinking more along the lines
of something that would extract such diagrams automatically.

-- Sean Silva

Hello Sean Silva and List,

I've got an incomplete idea about implementing a utility which
extracts such diagrams automatically. And guess that there should
exist one already.

Let's say I want to draw a seq. diagram of an application.
- To draw the diagram I compile the application with a modified
version of clang/llvm.
- This modified clang/llvm inserts some extended llvm intrinsic
function calls into start and end of every functions.
- Then I execute the application for the scenario needed to draw the
seq. diagram for the application.
- Executing the application generates a binary file.
- A utility like any other llvm utility reads the binary output file
and draw seq. diagram of the application for the tested scenario.
- The utility which draws the seq. diagram is easily configurable.

I think, to do this, a set of extended llvm intrinsic functions which
print out logging message of each function calls/returns must be
implemented.
And this intrinsic functions can be added via llvm optimization pass.

This is my brief and incomplete idea.
And I think this could also be an item of patent if is not registered ever.
But I believe not. This is so simple and easy. There should exist
already implemented software which does this better. Maybe Rose or
stuffs like this I doubt.

I'd like
- to know if there exist one or some similar to my idea. (Regardless
of weather it is based on llvm)
- to know if my idea is realistic and possible?

I wish I could implement this myself.

Sincerely
Journeyer

You can easily collect this information with DTrace on a Mac (or
Solaris or FreeBSD) without any special LLVM instrumentation.

-- Sean Silva

Oh I see. Thank you. I will study that.

Journeyer

You will want to use the pid provider. The most basic thing you can
probably do is to turn on flowindent and just trace
`pid$target:::entry' and `pid$target:::return`, which will trace all
the function calls and returns. This blog post
<http://cuddletech.com/blog/pivot/entry.php?id=923> gives an example
of the script I'm thinking of (this is one of the most basic DTrace
scripts).

Also, you may want to compile at -O0, because DTrace can't instrument
functions that have been inlined.

-- Sean Silva

Thank you Sean Silva!

I guess DTrace should be very useful.
Thank you.

Journeyer