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

If you're asking what I think you're asking, check out these recent threads:

http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-February/029245.html
http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-February/029395.html

Trevor

Hi Arvind,

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.

this is a frequently asked question, so you should be able to find plenty
of info by searching the mailing list archives. The usual answer is to
use debug info.

Ciao,

Duncan.

Duncan Sands wrote:

Hi Arvind,

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.
    
this is a frequently asked question, so you should be able to find plenty
of info by searching the mailing list archives. The usual answer is to
use debug info.
  
I believe our mailing list archives are unsearchable with Google (and, I assume, other search engines). I'm guessing this is due to a robots.txt file or something like that. As far as I know, there is no good way to search the archives. I suspect the long-term solution is to move the mailing lists to llvm.org.

Can someone confirm or correct my above observations/assumptions?

Regarding the original question on mapping LLVM IR to source code, we should probably put something into the FAQ about this question. I don't have time to do that now (I'm technically taking today off work and will be gone this weekend), but can do it next week if no one beats me to it.

-- John T.

John Criswell <criswell@uiuc.edu> writes:

Duncan Sands wrote:

this is a frequently asked question, so you should be able to find plenty
of info by searching the mailing list archives. [...]
  
I believe our mailing list archives are unsearchable with Google (and, I
assume, other search engines). I'm guessing this is due to a robots.txt
file or something like that. As far as I know, there is no good way to
search the archives.

You can use gmane.org to search, and Google at least partly indexed
the mailing list at gmane.org. For example, searching the title of
this thread in google answers with this:
http://permalink.gmane.org/gmane.comp.compilers.llvm.devel/30520

I just updated SourceLevelDebugging.html.

Please feel free to improve the paragraph if it needs further clarification.

John Criswell wrote:

Duncan Sands wrote:

Hi Arvind,

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.

this is a frequently asked question, so you should be able to find plenty
of info by searching the mailing list archives. The usual answer is to
use debug info.

I believe our mailing list archives are unsearchable with Google (and, I
assume, other search engines). I'm guessing this is due to a robots.txt
file or something like that. As far as I know, there is no good way to
search the archives. I suspect the long-term solution is to move the
mailing lists to llvm.org.

There is a google group mirroring the mailing list: http://groups.google.com/group/llvm-dev

Nick