[PATCH] D35994: Debug info for variables whos type is shrinked to bool

Nikola Prica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 00:39:56 PDT 2017


NikolaPrica added inline comments.


================
Comment at: lib/Transforms/IPO/GlobalOpt.cpp:1577
+  for(auto *GV : GVs)
+    NewGV->addDebugInfo(GV);
+
----------------
aprantl wrote:
> I'm not familiar with this transformation: Do we need to add a DIExpression to mask out all but the first bit (i.e. can multiple bools be packed into the same uint32_t such that it could confuse debuggers)?
The debug info which is provided here with addDebugInfo later generates address of the variable (DW_OP_addr: xxxx) in DW_AT_location. If we provide here metadata which is for 1byte variable  the debugger would get confused because the enum type is written as 4-byte and he would try to read 4 bytes. This is just temporary fix until proper way to handle this is found.


https://reviews.llvm.org/D35994





More information about the llvm-commits mailing list