Clang Plugins

Dear All,

We're looking to integrate our memory safety transforms into Clang so that a simple command-line option to Clang will compile code with memory safety checks.

We had originally believed that we would need to modify Clang, but Chris Lattner suggested that we investigate a new plugin infrastructure that is in development in Clang by Doug (I think it has something to do with PassManagerBuilder.h).

Is there documentation on this infrastructure, and if so, where can we find it?

Thanks in advance,

-- John T.

As much as I'd love to see an improved plugin framework, I'm not actively working on one.

  - Doug

Dear All,

We're looking to integrate our memory safety transforms into Clang so
that a simple command-line option to Clang will compile code with memory
safety checks.

We had originally believed that we would need to modify Clang, but Chris
Lattner suggested that we investigate a new plugin infrastructure that
is in development in Clang by Doug (I think it has something to do with
PassManagerBuilder.h).

As much as I'd love to see an improved plugin framework, I'm not actively working on one.

To quote Chris, "Doug gave a talk at boostcon about doing ast transformations with it, but no it is not very mature at all. The static analyzer is moving to it, but there are no widely used plugins yet." [1]

Are you the Doug that discussed the Clang plugin infrastructure at boostcon? If so, did I misunderstand Chris when he said that work had started on it but that it was in the early stages?

-- John T.

[1] http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20110718/124614.html

There's not much work going on in that area now, although you can check out the examples in the Clang tree for plugins that do currently exist, and how they fit in. There is much to be improved.

  - Doug

snip]

There's not much work going on in that area now, although you can check out the examples in the Clang tree for plugins that do currently exist, and how they fit in. There is much to be improved.

Where can I find these examples in the Clang source tree? Is there a class whose name I can grep for in the source code to help locate these examples?

-- John T.

examples/PrintFunctionNames is the example I had in mind. It shows how to introduce a new ASTConsumer via a plugin.

  - Doug

snip]

There's not much work going on in that area now, although you can check out the examples in the Clang tree for plugins that do currently exist, and how they fit in. There is much to be improved.

Where can I find these examples in the Clang source tree? Is there a class whose name I can grep for in the source code to help locate these examples?

examples/PrintFunctionNames is the example I had in mind. It shows how to introduce a new ASTConsumer via a plugin.

Okay. Thanks.

-- John T.