<div dir="ltr"><div>Hi Hideto,</div><div>thanks for your answer. Unfortunately I'm still using llvm 6.0 and in llvm-dis I don't see that option. I tried reading the full list of options but I didn't see an alternative.</div><div><br></div><div>Do you have any suggestions?</div><div><br></div><div>Thanks</div><div>Alberto<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno dom 8 dic 2019 alle ore 08:50 Hideto Ueno <<a href="mailto:uenoku.tokotoko@gmail.com">uenoku.tokotoko@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Alberto, <div><br></div><div>Variable names in LLVM IR are meaningless and only used for debugging.</div><div>However, if you want to preserve the variable name, you can use `-fno-discard-value-names` option.</div><div><br></div><div>Regards,</div><div>Hideto</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2019年12月8日(日) 17:38 Alberto Barbaro via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div>I'm trying to obtain a .ll with parameters name for every function. My simple c C is the following:</div><div><br></div><div>int sum(int a, int b) {<br> return a+b;<br>}<br><br>int main() { <br> sum(1,2);<br>}</div><div><br></div><div>I obtain the .ll with the following commands:</div><div><br></div><div>clang -emit-llvm sum.c -c</div><div>llvm-dis-7 sum.bc</div><div><br></div><div>The obtained .ll is:</div><div><br></div><div>cat sum.ll <br>; ModuleID = 'sum.bc'<br>source_filename = "sum.c"<br>target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"<br>target triple = "x86_64-pc-linux-gnu"<br><br>; Function Attrs: noinline nounwind optnone uwtable<br>define i32 @sum(i32, i32) #0 {<br> %3 = alloca i32, align 4<br> %4 = alloca i32, align 4<br> store i32 %0, i32* %3, align 4<br> store i32 %1, i32* %4, align 4<br> %5 = load i32, i32* %3, align 4<br> %6 = load i32, i32* %4, align 4<br> %7 = add nsw i32 %5, %6<br> ret i32 %7<br>}<br><br>; Function Attrs: noinline nounwind optnone uwtable<br>define i32 @main() #0 {<br> %1 = call i32 @sum(i32 1, i32 2)<br> ret i32 0<br>}<br><br>attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }<br><br>!llvm.module.flags = !{!0}<br>!llvm.ident = !{!1}<br><br>!0 = !{i32 1, !"wchar_size", i32 4}<br>!1 = !{!"clang version 6.0.1-svn334776-1~exp1~20190309042703.125 (branches/release_60)"}</div><div><br></div><div>Could you tell me why I don't see a and b parameters for the sum function?</div><div><br></div><div>Thanks</div><div>Alberto<br></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</blockquote></div>