<br clear="all">Hi,<br>   I was wondering how to add header files to code in LLVM. I am trying to create a small profiler to track the actual time spent in functions.<br>For this i am adding call to clock() in the C code of the given program. However this will require adding the file time.h to C code. Can some  tell me a way to do so.<br>

I have tried using Module.addLibrary("time.h"); but this doesn't seem to address the problem because I am not able to get the type clock_t by using Module.getType() .Moreover only adding just the module.addlibrary does not add the header file in the generated c code.<br>

 It would be a great help if someone could shed light as to how to introduce header files by a transformation pass and able to use the types defined in the header file in the pass itself.<br>A similar scenario can arise in a parallelizing transformation where one is trying to create threads but this requires inclusion of pthread.h to access the types like pthread_t. etc.<br>

-- <br>Kshitiz Garg<br>Graduate Student<br>Department of Computer Science & Engineering<br>IIT Kanpur<br><br>