[LLVMdev] C++ to C

Mohd-Hanafiah Abdullah napi at axiomsol.com
Fri Nov 17 00:42:23 PST 2006


On Thu, 2006-11-16 at 21:08 -0800, Chris Lattner wrote:
> 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.

Thanks.  Do I need to deal with the long names like
_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc() or is there an
option to use the shorter version?

Cheers.

Napi




More information about the llvm-dev mailing list