[LLVMdev] reference to %llvm.dbg.variable in source level debug docs

Eli Bendersky eliben at gmail.com
Tue Feb 1 22:35:35 PST 2011


>> 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 !13

In 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




More information about the llvm-dev mailing list