Eli Bendersky
2011-Feb-01 11:58 UTC
[LLVMdev] reference to %llvm.dbg.variable in source level debug docs
Hello I'm reading http://llvm.org/docs/SourceLevelDebugging.html and some things aren't clear. There are a couple of references made to %llvm.dbg.variable, which isn't defined anywhere. It it an intrinsic? A global? Could it be a relic from the old debug info docs (where it *is* defined?). The same goes for llvm.dbg.derivedtype and llvm.dbg.subrange which are also referenced but not defined. Additionally, there's this definition: """ void %llvm.dbg.declare(metadata, metadata) This intrinsic provides information about a local element (ex. variable.) The first argument is metadata holding alloca for the variable.. The second argument is the %llvm.dbg.variable containing the description of the variable. """ I see all uses of llvm.dbg.declare having values/types as first argument, not metadata. What am I missing? Thanks in advance, Eli
Devang Patel
2011-Feb-01 17:27 UTC
[LLVMdev] reference to %llvm.dbg.variable in source level debug docs
On Feb 1, 2011, at 3:58 AM, Eli Bendersky wrote:> Hello > I'm reading http://llvm.org/docs/SourceLevelDebugging.html and some > things aren't clear. > > There are a couple of references made to %llvm.dbg.variable, which > isn't defined anywhere. It it an intrinsic? A global? Could it be a > relic from the old debug info docs (where it *is* defined?). The same > goes for llvm.dbg.derivedtype and llvm.dbg.subrange which are also > referenced but not defined.It was a stale reference. I fixed the docs.> > Additionally, there's this definition: > > """ > void %llvm.dbg.declare(metadata, metadata) > > This intrinsic provides information about a local element (ex. > variable.) The first argument is metadata holding alloca for the > variable.. The second argument is the %llvm.dbg.variable containing > the description of the variable. > """ > > I see all uses of llvm.dbg.declare having values/types as first > argument, not metadata. What am I missing?I am seeing call void @llvm.dbg.declare(metadata !{i32* %argc.addr}, metadata !12), !dbg !13 ? - Devang
Eli Bendersky
2011-Feb-02 06:35 UTC
[LLVMdev] reference to %llvm.dbg.variable in source level debug docs
>> There are a couple of references made to %llvm.dbg.variable, which >> isn't defined anywhere. It it an intrinsic? A global? Could it be a >> relic from the old debug info docs (where it *is* defined?). The same >> goes for llvm.dbg.derivedtype and llvm.dbg.subrange which are also >> referenced but not defined. > > It was a stale reference. I fixed the docs.Thanks. Is llvm.dbg.derivedtype.type also a stale reference? It's mentioned in "Derived type descriptors" but isn't described or defined anywhere.>> Additionally, there's this definition: >> >> """ >> void %llvm.dbg.declare(metadata, metadata) >> >> This intrinsic provides information about a local element (ex. >> variable.) The first argument is metadata holding alloca for the >> variable.. The second argument is the %llvm.dbg.variable containing >> the description of the variable. >> """ >> >> I see all uses of llvm.dbg.declare having values/types as first >> argument, not metadata. What am I missing? > > I am seeing > call void @llvm.dbg.declare(metadata !{i32* %argc.addr}, metadata !12), !dbg !13In the example IR of http://llvm.org/docs/SourceLevelDebugging.html, section "Object lifetimes and scoping", there is: call void @llvm.dbg.declare({}* %2, metadata !12), !dbg !14 Which isn't exactly like the llvm.dbg.declare intrinsic is defined - in the definition the first argument is also metadata. Indeed, generating IR from C files using trunk clang, I also see: call void @llvm.dbg.declare(metadata !{i32* %a.addr}, metadata !22), !dbg !23 Which is different from what http://llvm.org/docs/SourceLevelDebugging.html shows. Eli
Apparently Analagous Threads
- [LLVMdev] reference to %llvm.dbg.variable in source level debug docs
- [LLVMdev] reference to %llvm.dbg.variable in source level debug docs
- [LLVMdev] llvm dwarf debug info for locals with llvm.dbg.define
- [LLVMdev] A few more questions about DIFactory and source-level debugging.
- [LLVMdev] llvm dwarf debug info for locals with llvm.dbg.define