<div dir="ltr">Could you provide the complete example (with all the necessary metadata to reproduce)?<br><br>Possible LLVM has a special case for arguments, I'm not sure/don't recall off hand, but can poke around at it & see if there's a reasonable logic to it.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 20, 2016 at 10:43 PM Carlo Kok via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I want to emit a ref parameter (ie i32*) as if it was i32 in debug info,<br class="gmail_msg">
however when I emit it with llvm.debug.declare referring to the<br class="gmail_msg">
parameter register it shows the actual pointer value of the debug<br class="gmail_msg">
register, instead of the value it refers to. This works fine if the<br class="gmail_msg">
llvm.debug.declare points to a local alloca, how can this be and how can<br class="gmail_msg">
I make it work so both show the integer value directly?<br class="gmail_msg">
<br class="gmail_msg">
define void @test1(i32) #0 !dbg !5 {<br class="gmail_msg">
BasicBlock0:<br class="gmail_msg">
%1 = alloca i32<br class="gmail_msg">
store i32 %0, i32* %1<br class="gmail_msg">
call void @llvm.dbg.declare(metadata i32* %1, metadata !20, metadata<br class="gmail_msg">
!22), !dbg !23<br class="gmail_msg">
// This one is fine<br class="gmail_msg">
%2 = load i32, i32* %1, !dbg !24<br class="gmail_msg">
%3 = add i32 %2, 1, !dbg !24<br class="gmail_msg">
store i32 %3, i32* %1, !dbg !24<br class="gmail_msg">
ret void, !dbg !25<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
define void @ms_t1a_issuedebugouttest.__Global4_MEH2n_o_i32(i32*) #0<br class="gmail_msg">
!dbg !9 {<br class="gmail_msg">
BasicBlock3:<br class="gmail_msg">
call void @llvm.dbg.declare(metadata i32* %0, metadata !26, metadata<br class="gmail_msg">
!22), !dbg !28<br class="gmail_msg">
%1 = load i32, i32* %0, !dbg !29<br class="gmail_msg">
%2 = add i32 %1, 1, !dbg !29<br class="gmail_msg">
store i32 %2, i32* %0, !dbg !29<br class="gmail_msg">
ret void, !dbg !30<br class="gmail_msg">
}<br class="gmail_msg">
<br class="gmail_msg">
!22 = !DIExpression()<br class="gmail_msg">
<br class="gmail_msg">
!20 = !DILocalVariable(name: "i", scope: !21, file: !6, line: 11, type: !13)<br class="gmail_msg">
!26 = !DILocalVariable(name: "i", scope: !27, file: !6, line: 15, type: !13)<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "Integer", scope: !2,<br class="gmail_msg">
file: !3, baseType: !14)<br class="gmail_msg">
!14 = !DIBasicType(name: "Integer", size: 32, align: 32, encoding:<br class="gmail_msg">
DW_ATE_signed)<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Carlo Kok<br class="gmail_msg">
RemObjects Software<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div>