This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]