llvm::Type 2.9 and earlier used to have getDescription method to retrieve a string representation of the type. This method does not exist anymore in llvm 3.0.
I’m not sure if this is deprecated in favor of Type::print(raw_ostream&), but in any case I’m curious of this API. What examples are there about how to use it? How can I dump to a string or const char*?
In particular, I want to pass the string to Boost::Format which is a modern c++ sprintf.
I suppose, you need to create an instance of
llvm::raw_string_ostreamand pass your std::string into it’s construtor. Now you can use it asllvm::raw_ostreamand when you are done just call.str()to get your string.Something like that:
LLVM has changed its interface, so now the following will work: