[cfe-dev] Any way to disable typechecking while creating parse-tree for libtooling

Sourav Mukherjee sourav.mukherjee619 at gmail.com
Mon Jul 14 23:54:11 PDT 2014


 The header files are not there that is why it is transforming some
functions and not transforming some . That is the problem I am facing
as the incorrect portions are not there in the parse tree. Is there
any work around ?

On Tue, Jul 15, 2014 at 12:07 PM, Nikola Smiljanic <popizdeh at gmail.com> wrote:
> I don't think you can do much better than using a regular expression and
> treating your file as plain text... But why are you trying to transform
> ill-formed code?
>
>
> On Tue, Jul 15, 2014 at 4:27 PM, Sourav Mukherjee
> <sourav.mukherjee619 at gmail.com> wrote:
>>
>> replying to all :-
>> suppose i have a piece of code :-
>> if(y) //y is not declared
>>     cout<<1;
>>
>> my code cannot transform it to:-
>> if(y)
>> {
>>      //entering if condition y
>>
>>     //leaving if condition y
>> }
>>
>> After debuging , the reason i can think for this is that it happens as
>> the variable is undefined .
>> how can i ensure this ? I have written my code inside visit if statement
>> class .
>>
>> Nikola Smiljanic's reply:-
>>
>> 11:49 AM
>>
>>
>> cfe-dev
>> You forgot to reply to all, adding cfe-dev
>>
>> I don't think that you can transform invalid code, there's no ast for
>> it as you've noticed, but this is not surprising. You have to make
>> sure your code compiles, someone will correct me if I'm wrong.
>>
>>
>> Is there any other approach with using clang that such kind of
>> transformations can be done ?
>>
>>
>> On Tue, Jul 15, 2014 at 11:49 AM, Nikola Smiljanic <popizdeh at gmail.com>
>> wrote:
>> > You forgot to reply to all, adding cfe-dev
>> >
>> > I don't think that you can transform invalid code, there's no ast for it
>> > as
>> > you've noticed, but this is not surprising. You have to make sure your
>> > code
>> > compiles, someone will correct me if I'm wrong.
>> >
>> >
>> > On Tue, Jul 15, 2014 at 4:13 PM, Sourav Mukherjee
>> > <sourav.mukherjee619 at gmail.com> wrote:
>> >>
>> >> suppose i have a piece of code :-
>> >> if(y) //y is not declared
>> >>     cout<<1;
>> >>
>> >> my code cannot transform it to:-
>> >> if(y)
>> >> {
>> >>      //entering if condition y
>> >>
>> >>     //leaving if condition y
>> >> }
>> >>
>> >> After debuging , the reason i can think for this is that it happens as
>> >> the variable is undefined .
>> >> how can i ensure this ? I have written my code inside visit if
>> >> statement
>> >> class .
>> >>
>> >> On Tue, Jul 15, 2014 at 11:16 AM, Nikola Smiljanic <popizdeh at gmail.com>
>> >> wrote:
>> >> > Disable something that doesn't happen? That sounds strange, wouldn't
>> >> > you
>> >> > say
>> >> > :)? What exactly are you trying to achieve?
>> >> >
>> >> > Nikola
>> >> >
>> >> >
>> >> > On Tue, Jul 15, 2014 at 3:21 PM, Sourav Mukherjee
>> >> > <sourav.mukherjee619 at gmail.com> wrote:
>> >> >>
>> >> >> As i have seen that parse trees segments are not created for
>> >> >> segments
>> >> >> that have errors. Is there any way to disable that ?
>> >> >> _______________________________________________
>> >> >> cfe-dev mailing list
>> >> >> cfe-dev at cs.uiuc.edu
>> >> >> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>> >> >
>> >> >
>> >
>> >
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>



More information about the cfe-dev mailing list