This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: adding nodes in a tree --(about function name mangling)
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'sean yang'" <seanatpurdue at hotmail dot com>, <dberlin at dberlin dot org>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 25 Apr 2006 11:06:11 +0100
- Subject: RE: adding nodes in a tree --(about function name mangling)
On 25 April 2006 04:22, sean yang wrote:
> I want to insert the instrumentation code no matter from what language the
> MPI subroutines are called.
> I think I can take care of C and Fortran by the following (psuedo) code, but
> how can i find the rule for c++ name mangling? are there many cases that I
> need take care of?
>
> if (TREE_CODE ( t ) == FUNCTION_DECL){
>
> if (( !strncmp (IDENTIFIER_POINTER(DECL_NAME (t) , "mpi_", 4) || (
> !strncmp (IDENTIFIER_POINTER(DECL_NAME (t) , "_mpi_", 5)) {
> //(1) handles case of C language; (2) handle the case of Fortran
> }
>
> }
Why not cut right through your mess and declare your function extern "C"?
cheers,
DaveK
--
Can't think of a witty .sigline today....