[LLVMdev] C++ to C

Chris Lattner sabre at nondot.org
Thu Nov 16 21:08:07 PST 2006


On Fri, 17 Nov 2006, Mohd-Hanafiah Abdullah wrote:
> After converting a piece of C++ code to C one of the functions that are
> generated is this:
> _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc

This is defined in the C++ standard library.  You can get the demangled 
name like so:
$ c++filt _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
std::basic_ostream<char, std::char_traits<char> >& std::operator<< 
<std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> 
>&, char const*)

> Where is it defined and where can I find the source for it?  I need the
> source to compile it with a C compiler (AMPC) that will convert the C
> code to Java Bytecode.  If the above function is in C++ then I need to
> convert it to C first.

It comes with llvm-gcc4 in libstdc++.  You'll need to compile it to 
bytecode by modifying the makefile though.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list