How could I implement mygcc's Checking with Clang?‏

I am a post-graduate student from Beijing Institute of Technology in China and I am a newcomer to llvm/Clang and I am so interested at it.I have read Nic Volanschi’s Papers about Mygcc[1] and Condate[2].
In my opinion, this is a great job. Now I want to implement this Checking ability with Clang.But I find something different between gcc and Clang:

  1. The ASTs are so different
  2. As far as I know, Clang does not use a GIMPLE internal representation
  3. May other differences(As I am not familiar with Clang and gcc)

And another question:
How to transplant the condate.y parser to Clang?

So I want to know whether my idea is feasible.
If it is feasible, how could I solve the problems above?And Could anyone give me some suggestion about implementing mygcc’s Checking with Clang?For example, make use of ! ASTMatcher interface?

By the way, I have visited the mail of Samuel Harrington at http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-April/008599.html

Despite of this, I still want to know more about implementing the Checking ability with clang.

Thanks for your patient.

[1] http://mygcc.free.fr/
[2] http://mygcc.free.fr/condate-asej07.pdf

I am a post-graduate student from Beijing Institute of Technology in China
and I am a newcomer to llvm/Clang and I am so interested at it.I have read
Nic Volanschi's Papers about Mygcc[1] and Condate[2].
In my opinion, this is a great job. Now I want to implement this Checking
ability with Clang.But I find something different between gcc and Clang:
1. The ASTs are so different
2. As far as I know, Clang does not use a GIMPLE internal representation
3. May other differences(As I am not familiar with Clang and gcc)

And another question:
How to transplant the condate.y parser to Clang?

So I want to know whether my idea is feasible.
If it is feasible, how could I solve the problems above?And Could anyone
give me some suggestion about implementing mygcc's Checking with Clang?For
example, make use of ! ASTMatcher interface?

By the way, I have visited the mail of Samuel Harrington at
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-April/008599.html

Despite of this, I still want to know more about implementing the Checking
ability with clang.

Very high level answer:
You can use clang plugins to add checks to clang
(http://clang.llvm.org/docs/ClangPlugins.html).
The AST matchers can help you finding certain patterns you'd like to
detect (I'm working on more docs there); you can also use the
RecursiveASTVisitor directly
(http://clang.llvm.org/docs/RAVFrontendAction.html)

Cheers,
/Manuel

Thanks for your reply.
Could you give me more documents or examples about how to use the AST matchers?

Thanks for your reply.
Could you give me more documents or examples about how to use the AST
matchers?

I'm currently working on more documentation; until that lands, the
clang extra repository (http://clang.llvm.org/docs/ClangTools.html) is
a good way to start looking around.

Cheers,
/Manuel