[cfe-dev] is there a good example how to compile(execute) c code with libclang on the fly?

Jonathan Roelofs via cfe-dev cfe-dev at lists.llvm.org
Mon Oct 10 10:48:40 PDT 2016



On 10/10/16 11:17 AM, Dennis Luehring via cfe-dev wrote:
> i've already found the other blogs/projects before
>
> the idea was to not generate an executeable on disk but run it directly
> from memory - could that be possible (linux, windows?)

Cling does exactly that:

https://github.com/vgvassilev/cling


Jon

>
> Am 10.10.2016 um 01:47 schrieb Ben Coman via cfe-dev:
>> > Date: Sun, 9 Oct 2016 19:13:37 +0200
>> > From: Dennis Luehring via cfe-dev <cfe-dev at lists.llvm.org>
>> > To: Clang Dev <cfe-dev at lists.llvm.org>
>> > Subject: [cfe-dev] is there a good example how to compile(execute) c
>> >         code with libclang on the fly?
>> > Message-ID: <efbadb7e-f142-a1f8-cc18-0aced61202a6 at gmx.net>
>> > Content-Type: text/plain; charset=iso-8859-15; format=flowed
>> >
>> > i want to compile simple c functions from strings with libclang and
>> execute
>> > them on the fly inside my application
>> >
>> > its is for an simple function evaluator experiment with c as a
>> scripting
>> > language
>> >
>> > any ideas/links?
>> >
>> >
>>
>> Possiblities...
>>
>> Handmade Hero Day 021 - Loading Game Code Dynamically
>> https://m.youtube.com/watch?v=WMSBRk5WG58
>>
>> Handmade Hero Day 022 - Instantaneous Live Code Editing
>> https://m.youtube.com/watch?v=oijEnriqqcs
>>
>> Handmade Hero Day 023 - Looped Live Code Editing
>> https://m.youtube.com/watch?v=xrUSrVvB21c
>>
>> http://fdiv.net/2012/08/15/compiling-code-clang-api
>> https://root.cern.ch/cling
>>
>> https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus
>> https://github.com/RuntimeCompiledCPlusPlus/RuntimeCompiledCPlusPlus/wiki/Alternatives
>>
>>
>> cheers -ben
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded



More information about the cfe-dev mailing list