Building CFG piece by piece

Hello,

Can somebody give me a hint on AnalysisManager component Indexer?

I used checker to build CFG for my needs but now I am trying to build CFG as
a part of the tool. And here it was told that building it through
AnalysisManager is a good idea, so I found this
<http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-December/012535.html&gt; and
quite confused as doxygen tell about clang::idx::Indexer while in clang's
code(AnalysisConsumer.cpp) it uses CheckerManager when initializing
AnalysisManager.

Thank you in advance,
Vadim Brodskiy

Vadim,

Please, provide more information on what you are trying to do.

AnalysisManager is a part of clang static analyzer. What do you mean by Indexer component of AnalysisManager?

If you are not using the static analyzer functionality, you don't need AnalysisManager. AnalysisDeclContext has a getter for CFG, this is how AnalysisManager gets it. The static analyzer is not the only user of CFG.

Anna.

Thank you, Anna, you helped me very much understanding how it works. I'm
building it now via modified ASTConsumer and RecursiveASTVisitor and it is
building me CFG like in checker.

I also have a question on the output formatting of CFG. The CFG outputted
this way is easier to read if generated this way, but still sometimes I
encounter something like:
...
3: n (ImplicitCastExpr, LValueToRValue, int)
T: switch [B10.3]
...
Is there any way to mute "ImplicitCastExpr, LValueToRValue" and other like
this as it brings no use for me?

Vadim

Thank you, Anna, you helped me very much understanding how it works. I'm
building it now via modified ASTConsumer and RecursiveASTVisitor and it is
building me CFG like in checker.

I also have a question on the output formatting of CFG. The CFG outputted
this way is easier to read if generated this way, but still sometimes I
encounter something like:
...
3: n (ImplicitCastExpr, LValueToRValue, int)
T: switch [B10.3]
...
Is there any way to mute "ImplicitCastExpr, LValueToRValue" and other like
this as it brings no use for me?

You could modify CFG printer not to print the implicit l-value to r-value casts (in your source tree)...