<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt"><br><br><div class="gmail_quote">On Sat, Dec 1, 2012 at 9:44 AM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
================<br>
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1121<br>
@@ +1120,3 @@<br>
+  if (AllocaType == Int8PtrTy)<br>
+    Res |= handleValueLifetime(Alloca);<br>
+  for (Value::use_iterator UI = Alloca->use_begin(), UE = Alloca->use_end();<br>
----------------<br>
</div><div class="im">Alexey Samsonov wrote:<br>
> Kostya Serebryany wrote:<br>
> > This function where you call handleValueLifetime multiple times is hard to understand. I'd really prefer to iterate over all llvm.lifetime.start<br>
> > markers instead.<br>
> I've added comment to the original function. I think that iterating over lifetime markers wouldn't be easier: you'll have to store the set of allocas we merge (ok), but when you take a lifetime marker, you should check if its argument was in fact casted from the one of these allocas...<br>

>> you'll have to store the set of allocas we merge<br>
</div>Actually, no.<br>
<br>
the instruction should look something like<br>
  llvm.lifetime.start((i8*)(grand_alloca+offset)),<br>
so you just need to check for that pattern.<br>
<br>
I think this will make the code easier to understand and a bit more robust (less chance to miss some of the llvm.lifetime.start).<br>
<br>
Still, if you feel strong about your solution, please commit now.<br>
It should be ok too.<br>
<br></blockquote><div>Submitted this as r169200. Will go to Clang part / more intensive testing / bootstrapping soon.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
<a href="http://llvm-reviews.chandlerc.com/D140" target="_blank">http://llvm-reviews.chandlerc.com/D140</a></blockquote></div><div><br></div>-- <br><div>Alexey Samsonov, MSK</div><br>
</div>