<div dir="ltr">I would guess there's no one bug here - debug info quality (specifically/especially the location of variables when compiling with optimizations enabled) is a long tail/sliding scale of issues. LLVM is, on the whole, not spectacular at this - a matter of bugs to fix, some small/simple, others more systemic/representational.<br><br>If you're interested in contributing to this work - generally the first step is to isolate the problem - first thing you can do is if you have some experience dumping/examining debug info in object files, you can dump/examine the relevant object files then try to reduce/remove code from the relevant objects, etc, to see what the minimal example is that'll make it easier to figure out how to fix.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 9, 2021 at 12:37 AM Tobias Hieta 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
We recently switched our windows builds from the CL compiler to<br>
clang-cl. This was a pretty big jump in terms of code generation and<br>
having a uniform compiler across all the major platforms.<br>
<br>
Our setup is that our Windows developer use MSVC as the IDE and<br>
compile with our own build of clang-cl and link with lld-link.<br>
<br>
Some of the developers noticed that some of the debug information are<br>
not as good as with CL. Or rather some variables seems to be optimized<br>
out, this is what the IDE says, see attached screenshot. I have tried<br>
to figure out if there is a rhyme and reason to what variables are<br>
gone - but I have not been able to see any pattern.<br>
<br>
Our command line is:<br>
<br>
clang-cl.exe /nologo -DUNICODE -DUSE_BREAKPAD -DWIN32<br>
-DWIN32_LEAN_AND_MEAN -DWINVER=0x0601 -D_CRT_NONSTDC_NO_DEPRECATE<br>
-D_CRT_SECURE_NO_WARNINGS -D_LEGACY_NAT_TRAVERSAL_ -D_REENTRANT<br>
-D_SCL_SECURE_NO_WARNINGS -D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS<br>
-D_UNICODE -D_WIN32_WINNT=0x0601 -D_WINSOCK_DEPRECATED_NO_WARNINGS<br>
-Iincludes -m32 -fdiagnostics-absolute-paths<br>
--target=i686-windows-msvc -m32 /DWIN32 /D_WINDOWS /GR /EHsc /Zi /Ob0<br>
/Od /RTC1 -MDd /Zm512 /EHsc /bigobj /W3 -Werror -Wsign-compare<br>
-Wno-reorder-ctor -Wno-delete-non-virtual-dtor -Wunused-variable<br>
-Wuninitialized -std:c++14<br>
<br>
Is there any good way to debug this or is it a known limitation with<br>
clang-cl or 32 bit (we don't do 64 yet - but with clang-cl we hope to<br>
move towards that soon). Or am I missing some flags?<br>
<br>
Thanks,<br>
Tobias<br>
_______________________________________________<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>