[LLVMdev] Scheme + LLVM JIT

Alexander Friedman alex at inga.mit.edu
Fri May 13 09:22:16 PDT 2005


> > This requires being able to parse strings. The LLVM 'Parser.h' interface 
> > (and implementation) has the built in assumptions that it will always be 
> > parsing from the file system. Would you guys accept a patch that makes 
> > it more general (ie, parse from file or string)?
> 
> Yes, that's a generally useful thing to have, I'd like to see it happen if 
> it doesn't impact the efficiency of the lexer.

Ok, here's a patch. I added a 'parseAsmString' function to the Parser
interface. It doesn't seem to break any tests, so parsing files seems
to still work ok.

I commented out some code/global variables that don't seem to be
usefull anymore - feel free to remove those lines completely if they
are in fact not.

I havn't tested parsing strings yet. My code is extremely simple and
*should* work, but we know where that line of thinking leads. Should I
submit a test case (it would have to be a C file that links in the
parser)?

> > void * M = llvm_make_module_from_text (program, "test") ;
> 
> One of these should be fib_function right?  What is the 'test' string?

In the fib example, the module is named 'test', so I assumed it was
usefull for some reason.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: asm_parser.diff
Type: application/octet-stream
Size: 9012 bytes
Desc: parse asm strings
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050513/8d0e347e/attachment.obj>
-------------- next part --------------


-- 


-Alex


More information about the llvm-dev mailing list