On Aug 31, 2009, at 1:19 PM, Renato Golin wrote:> 2009/8/31 Axel Naumann <Axel.Naumann at cern.ch>: >> we want to implement a C++ interpreter using LLVM and clang > > Isn't clang going on that direction anyway?Clang is meant to be flexible enough to be used as the basis for a C++ interpreter. However, there will probably be a bit of work to do in Clang to make this happen, e.g., by providing clean APIs for an interpreter to call into Clang's parser to parse a new expression/ statement/function. - Doug
2009/8/31 Douglas Gregor <dgregor at apple.com>:> Clang is meant to be flexible enough to be used as the basis for a C++ > interpreter. However, there will probably be a bit of work to do in Clang to > make this happen, e.g., by providing clean APIs for an interpreter to call > into Clang's parser to parse a new expression/statement/function.Ok, my bad, language barrier. ;) Speaking of those APIs, I guess if you do have something of the sort, it may be easy to evaluate expressions and understanding the structure of a program on a debugger. If you manage to parse dwarf information on the same structure as clang (or the interpreter) does with code, one can later list the members of a class, print their values etc. cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm
Hi Renato, Renato Golin wrote on 09/01/2009 10:40 AM:> 2009/8/31 Douglas Gregor <dgregor at apple.com>: >> Clang is meant to be flexible enough to be used as the basis for a C++ >> interpreter. However, there will probably be a bit of work to do in Clang to >> make this happen, e.g., by providing clean APIs for an interpreter to call >> into Clang's parser to parse a new expression/statement/function. > > Speaking of those APIs, I guess if you do have something of the sort, > it may be easy to evaluate expressions and understanding the structure > of a program on a debugger.Correct. As a matter of fact we use the current interpreter's knowledge also for introspection and serialization.> If you manage to parse dwarf information on the same structure as > clang (or the interpreter) does with code, one can later list the > members of a class, print their values etc.Right, having a working interactive C++ interpreter would also help for a debugger, as you said assuming that the symbols "are there". Function calls will be possible, too; you could also create objects in the interpreter stack and evaluate them. So - are you interested? :-) Cheers, Axel.
Reasonably Related Threads
- [LLVMdev] C++ Interpreter
- [LLVMdev] C++ Interpreter
- [LLVMdev] [cfe-dev] RFC: A proposal to move toward using C++11 features in LLVM & Clang / bounding support for old host compilers
- [LLVMdev] [cfe-dev] RFC: A proposal to move toward using C++11 features in LLVM & Clang / bounding support for old host compilers
- [LLVMdev] cmake configured buildbot