<div dir="ltr">Hello LLVM Experts,<br>Please ignore the last email. I'm trying to get the location of used variables inside the function pass. <br><br>For example:<div><b>Symbol a = [4, 4, 6] lines<br>Symbol b= [5, 5, 7] lines</b><br><br><b><u>C code:</u></b><br>void bar() {<br>    int a = 10;   //line 2<br>    int b = 20;   //line 3<br>    a = a + 5;    //line 4<br>    b = b + 1;   //line 5<br>    a++;           //line 6<br>    b--;            //line 7<br>}<br><br><b><u>LLVM IR:</u></b><br>  %a = alloca i32, align 4<br>  %b = alloca i32, align 4<br>  call void @llvm.dbg.declare(metadata i32* %a, metadata !10, metadata !DIExpression()), !dbg !12<br>  store i32 10, i32* %a, align 4, !dbg !12<br>  call void @llvm.dbg.declare(metadata i32* %b, metadata !13, metadata !DIExpression()), !dbg !14<br>  store i32 20, i32* %b, align 4, !dbg !14</div><div><br>  %0 = load i32, i32* <b>%a</b>, align 4, !dbg !15<br>  %add = add nsw i32 %0, 5, !dbg !16<br>  store i32 %add, i32* <b>%a</b>, align 4, !dbg !17<br>  %1 = load i32, i32* <b>%b</b>, align 4, !dbg !18<br>  %add1 = add nsw i32 %1, 1, !dbg !19<br>  store i32 %add1, i32* <b>%b</b>, align 4, !dbg !20<br>  %2 = load i32, i32* <b>%a</b>, align 4, !dbg !21<br>  %inc = add nsw i32 %2, 1, !dbg !21<br>  store i32 %inc, i32* <b>%a</b>, align 4, !dbg !21<br>  %3 = load i32, i32* <b>%b</b>, align 4, !dbg !22<br>  %dec = add nsw i32 %3, -1, !dbg !22<br>  store i32 %dec, i32* <b>%b</b>, align 4, !dbg !22<br>  ret void, !dbg !23<br>}<br>!10 = !DILocalVariable(name: "a", scope: !7, file: !1, line: 2, type: !11)<br>!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)<br>!12 = !DILocation(line: 2, column: 7, scope: !7)<br>!13 = !DILocalVariable(name: "b", scope: !7, file: !1, line: 3, type: !11)<br>!14 = !DILocation(line: 3, column: 7, scope: !7)<br>!15 = !DILocation(line: 4, column: 7, scope: !7)<br>!16 = !DILocation(line: 4, column: 9, scope: !7)<br>!17 = !DILocation(line: 4, column: 5, scope: !7)<br>!18 = !DILocation(line: 5, column: 7, scope: !7)<br>!19 = !DILocation(line: 5, column: 9, scope: !7)<br>!20 = !DILocation(line: 5, column: 5, scope: !7)<br>!21 = !DILocation(line: 6, column: 4, scope: !7)<br>!22 = !DILocation(line: 7, column: 4, scope: !7)<br>!23 = !DILocation(line: 8, column: 2, scope: !7)<br><br><br>Thanks and Regards.</div></div>