Hi, I am writing a pass in which I need to insert a call to a library function. Specifically I need to call the function "pthread_mutex_lock" from the library "pthread". I am working on GIMPLE, specifically after the "build_cfg" pass.
Looking around the documentation, what I found is I will have to use the function gimple_build_call. My question is how do I build the tree fn, and the arguments which have to be provided to gimple_build_call. Do I have to use build_function_type_list and build_fn_decl for building tree fn? The original function call "pthread_mutex_lock" requires an "pthread_mutex_t" type variable as an argument, how can I declare that in the pass, and use it as an argument in gimple_build_call? Thanks, Ashish