UML Reverse Engineering based on C++ code

24 views
Skip to first unread message

Jocelyn CHALENDARD

unread,
Oct 4, 2018, 10:12:10 AM10/4/18
to cl...@chromium.org

Good afternoon,


I am reaching you from this page https://chromium.googlesource.com/chromium/src/+/lkgr/docs/writing_clang_plugins.md

Make sure you really want to write a clang plugin. The clang plugin api is not stable. If you write a plugin, you are responsible for making sure it's updated when we update clang. If you're adding a generally useful warning, it should be added to upstream clang, not to a plugin.
because I am interested into writing a Clang plugin to perform reverse engineering on C++ code: I want to extract sequence diagram and statechart (let say from a specific implementation such as state design pattern) from C++ code.
I would like to use Clang parser to create dot graph and render those in Doxygen.

How does that sound to you?


Thanks in advance,


Regards,


Jocelyn Chalendard
Software Engineer,
Somfy - Home & Building Technical Department
1484057919013_OutlookEmoji-1476342704496_PastedImage.png

------------------ Internet Email Confidentiality Footer ------------------
The information  transmitted in this document  is  intended  only  for  the
person  or  entity to whom it is addressed  and  may  contain  confidential
and/or privileged material. Any review,  retransmission,  dissemination  or
other use of,  or taking of any action in reliance upon this information by
persons or entities other than the intended recipient is prohibited. If you
received this in error,  please contact the sender and delete all copies of
the material.

Daniel Cheng

unread,
Oct 4, 2018, 2:13:36 PM10/4/18
to jocelyn.c...@somfy.com, Clang maintainers
On Thu, Oct 4, 2018 at 7:12 AM Jocelyn CHALENDARD <jocelyn.c...@somfy.com> wrote:

Good afternoon,


I am reaching you from this page https://chromium.googlesource.com/chromium/src/+/lkgr/docs/writing_clang_plugins.md

Make sure you really want to write a clang plugin. The clang plugin api is not stable. If you write a plugin, you are responsible for making sure it's updated when we update clang. If you're adding a generally useful warning, it should be added to upstream clang, not to a plugin.
because I am interested into writing a Clang plugin to perform reverse engineering on C++ code: I want to extract sequence diagram and statechart (let say from a specific implementation such as state design pattern) from C++ code.
I would like to use Clang parser to create dot graph and render those in Doxygen.

How does that sound to you?

I'm not quite sure exactly what you're trying to do: are you trying to graph the relationship between various classes? e.g. if a class has a unique_ptr of another class, we'd have an edge between those two classes that noted the strong ownership?

If this is what you're doing, using clang to help get an AST will be a useful start; you'll probably want to find a way to limit the max complexity of the graph by limiting it to a subset of the source tree though...

Daniel
Reply all
Reply to author
Forward
0 new messages