source code information in LLVM IR

Hi,

I am generating llvm IR code for C source code using clang as the
front end. I am wondering if there is any way of mapping an llvm IR
line number back to its C source code line number.

Thanks
Sincerely
Arvind

Hi Arvind,

This is a frequently asked question on the llvmdev list, please search the mailing list archives (e.g. on gmane) for responses.

-Chris

Hi all,

Thanks for all the help. I have successfully manage to create the debug info (using -g option in clang) and tap into it using llvm API (using DebugInfo.h). I am now able to print out the source line number for each llvm instruction.

Thanks
Best Regards
Arvind