[cfe-dev] Way to compare two Function bodies.

Pavan Pattanada pattanad at uci.edu
Wed Jul 17 16:18:25 PDT 2013


By "same", I mean, their ASTs to be the same to start with. I am working on
a tool,  which is used to syntactic/semantic similarity between two
versions of the code base. So far, I have been able to get the
FunctionDecls of both versions of a function into memory. But I am not sure
how to compare them.

~Pavan


On Wed, Jul 17, 2013 at 3:42 PM, Richard Smith <richard at metafoo.co.uk>wrote:

> On Wed, Jul 17, 2013 at 10:10 AM, Pavan Pattanada <pattanad at uci.edu>wrote:
>
>> Hi,
>> I need to compare two versions of the same clang::FunctionDecl function
>> body(a function in C). I would need to compare them statement by statement
>> and say if the two versions are the same. Is there a neat way to do this in
>> the clang framework?
>>
>
> This question is too vague to answer: what do you mean by "the same"? Same
> source text, same tokens, same tokens other than variable naming, something
> else?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130717/59637b1f/attachment.html>


More information about the cfe-dev mailing list