Wrapping ::print() in LLVM-C.


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,

dump_to_str.patch (2.65 KB)