[LLVMdev] Accessing metadata & creating DIVariable

Devang Patel dpatel at apple.com
Tue Mar 29 16:07:21 PDT 2011


On Mar 29, 2011, at 3:58 PM, Vedavyas Duggirala wrote:

> I get the filename and directory from  DISubprogram from reading
> llvm.dbg.sp and use
> that to DIBuiler::.createCompileUnit. This  leads to  "duplicate
> symbol" error from llc.

If the llvm::Module already has llvm.dbg.sp then you don't need to use DIBuilder::createCompileUnit(). The point, I am missing is how did you get llvm.dbg.sp in module ? 

It seems you already have generated debug info in llvm::Module using DIBuilder. If that is true then you don't need to use createCompileUnit() for the same translation unit. 

If you reading a llvm::Module which already has a debug info and you are trying to add more debug info in the module than DIBuilder is not the tool for you.

Have you looked at how clang generated debug info ?
-
Devang



More information about the llvm-dev mailing list