How to bind the entry point of a CFG

Dear Member,
I am new to clang framework. I am trying to bind the entry points of CFG by using below code.

StatementMatcher BBlock= CFGBlock(expr().bind(“entrypoint”));

The code giving me errors. Please guide me, how can I bind entry and exit points of CFG of a program.



You can retrieve the entry point of a CFG with the getEnty() method. Could elaborate on what you’d like to achieve?


Actually I want to analyze the basic block of a program for fault localization. I have a pointer to CFG and from that pointer I can access every basic block. Consequently this will allow me to access the entry and exit. But by somehow, I am failed to
(1) locate the position (line and column number) of entry and exit point of basic block,
(2) iterate over the statements of the basic block through CFGElement object. I am using the srcManager to identify the position (line and col number).
Anyhow, thank you for your reply.


Can you please guide me (possibly with a snippet of code) that how may I iterate over the statements inside a basic block. Lets suppose, I have a pointer to basic block ptrBB.