On Saturday 15 of December 2012, Marc-André Laverdière wrote:
Sounds to me like a big learning curve is involved - which is going to
be very distracting from research activities.
Depends. It is something new to learn, but the API is rather intuitive.
If someone can give me link to a good tutorial that gives me a good
feeling about it I may bite.
I don't think there's anything like that (yet, at least). The Clang tutorials
I could find only say how to create a very basic plugin, which is something
I've already sorted out for LO, so now it is about writing actual code using
Clang internal API (http://clang.llvm.org/doxygen/).
That said, at this point it should be enough just to give it a try. Under
compilerplugins/clang there are already several plugins, with 2 of them
(lclstaticfix.cxx and postfixincrementfix.cxx) doing code rewriting. Writing
a new one would mean something like looking at what's there, compile a
relevant piece of code with '-Xclang -ast-dump' options to get AST dump to
see how Clang represents it internally, and write a new plugin using the
relevant classes mentioned in the AST dump (and I find it much simpler to
check them out in CLANGDIR/include/clang/AST/ rather than the doxygen
documentation).
It's not exactly trivial, but it's probably simpler to get than a lot of LO
code. If you decide to give it a try, feel free to ask if you run into
trouble.
--
Lubos Lunak
l.lunak@suse.cz
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.