This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Java name-mangling
>>>>> "Martin" == Martin v Loewis <martin@loewis.home.cs.tu-berlin.de> writes:
>> Unfortunately, the code depends on various aspects of the C++
>> front-end -- it nees to know about templates, overloaded
>> operators, and other C++-specific bits. Factoring the code
>> will be difficult, and will lead to code that is considerably
>> less clear.
Martin> Would it be possible to share the exact same source code,
Martin> but compile it differently for use in jc1?
I thought about this, and it does seem possible. Difficult, but
possible. I would suggest the following approach:
- Symlink cp/mangle.c into Java-land during the build process.
- Compile it.
- That won't work; there will be undefined symbols, and compilation
failures due to macros being undefined.
- Start adding things, as Martin suggests, that indicate the
non-existence of C++ features.
- Do the additions under:
#if MANGLING_JAVA_CODE
at the top of the file, to localize changes.
I agree that this sounds like the best approach.
This would be great, because that would get us over one hump. I'll
respond to Per's message about the layout issues next.
Thanks,
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com