[LLVMdev] Wrapping ::print() in LLVM-C.

Mahadevan R mdevan.foobar at gmail.com
Mon May 19 08:27:22 PDT 2008


Hi.

The LLVM-C bindings wrap over Module::dump() and Value::dump().
However, it'd be nice to have wrappers for Module::print(),
Value::print() and Type::print(), with the result returned as a
string. This would be more useful to the caller (especially when
LLVM-C is used in further restriced environments like Python!).

This also improves testability of the Python and OCaml bindings, where
a module can be created and it's dump compared against a known result
using just a string comparison.

A patch which adds these functions to LLVM-C, as
LLVMDump{Module,Value,Type}ToString() is attached.

Thanks & Regards,
-Mahadevan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dump_to_str.patch
Type: text/x-diff
Size: 2714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080519/3cc6d92d/attachment.patch>


More information about the llvm-dev mailing list