[cfe-dev] Generate a header file from a source file with clang

Vassil Vassilev vvasilev at cern.ch
Sun Mar 23 13:59:20 PDT 2014


On 21/03/14 19:04, Philip Reames wrote:
> I hacked together a tool which did this a while back.  If you don't 
> care about is handling the full power of C++, it's not that difficult.
>
> Basically, run it through the parser, then perform walks over the AST.
Can I see the tool. Is it open source?
>
> Note: This assumes that the original code compiles cleanly _without_ 
> including your newly generated header.
>
> Note: I didn't use the 'plugin' mechanism.  So no comment on that part 
> of the question.
>
> Philip
>
> On 03/21/2014 10:17 AM, Vassil Vassilev wrote:
>> Hi,
>>   Maybe a silly question but I'd like your opinion on it:
>>   How difficult would be (if possible) to implement a clang plugin 
>> which can generate a header file from a source file with 
>> implementation. The idea is to ask clang to build a library from a 
>> 'single' source file to generate a header file for it.
>> Many thanks,
>> Vassil
>> _______________________________________________
>> 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