C++ name mangling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey

I never really looked into this much before but kind of just out of
curiosity where is it implemented. For example: C++ code:

int test (int)...

will generate the gimple:

int test(int) (int x)
{
  int D.2281;

  D.2281 = x + 1;
  return D.2281;
}

But then the aseembler name is:

_Z4testi:

I know you can do SET_DECL_ASSEMBLER_NAME on an fndecl. But not sure
how the mangling is done for C++ is there a convention to the c++
standard or is it compiler specific i imagine it must be some
standard. And where is it implemented in Rust you can do:

#[link_args = "-lreadline"]
extern {
    fn readline (p: *std::libc::c_char) -> * std::libc::c_char;
}

I would like to be able to do something like:

extern "c++" {
}

So then any rust program can call into c++ wrappers maybe? Maybe
leaving out templates and classes. Maybe i can do something like
SET_DECL_ASSEMBLER_NAME (cpp_mangle ("test"))

--Phil
--Phil




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux