[cfe-dev] How to bind the entry point of a CFG

Ijaz Ahmed via cfe-dev cfe-dev at lists.llvm.org
Tue Oct 29 20:23:19 PDT 2019


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*.



On Wed, Oct 30, 2019 at 12:19 PM Ijaz Ahmed <ijaz.uma at gmail.com> wrote:

> 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.
>
> Regards
> ijaz
>
> On Tue, Oct 29, 2019 at 8:37 PM Kristóf Umann <dkszelethus at gmail.com>
> wrote:
>
>> Hi!
>>
>> You can retrieve the entry point of a CFG with the getEnty() method.
>> https://clang.llvm.org/doxygen/classclang_1_1CFG.html#a376a2e0d1a66a46f6514fe9b863f1f52 Could
>> elaborate on what you'd like to achieve?
>>
>> Cheers,
>> Kristóf
>>
>> On Sun, 27 Oct 2019 at 08:14, Ijaz Ahmed via cfe-dev <
>> cfe-dev at lists.llvm.org> wrote:
>>
>>> 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.
>>>
>>> Regards
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> cfe-dev at lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20191030/a3bde81a/attachment.html>


More information about the cfe-dev mailing list