On Jan 18, 2012, at 5:47 PM, Eric Christopher wrote:
Why is there an 'llvm.dbg.lv.foo' created ?
At optimization level -O0+ , llvm.dbg.lv.foo is created to collect info of local variables found in function foo. If any variables (or argument) is completely deleted by optimizer or code generator then dwarf writer can use this information to at least provide signature (type, name etc..) of the lost variable/argument. One of the DIBuider's createLocalVariable() parameter, AlwaysPreserve, enables this.