<div dir="ltr">Eli, <div><br></div><div>Sending a patch according to <a href="http://llvm.org/bugs/show_bug.cgi?id=17303#c8">http://llvm.org/bugs/show_bug.cgi?id=17303#c8</a></div><div><br></div><div><div>--- lib/CodeGen/CGExpr.cpp (revision 193069)</div>
<div>+++ lib/CodeGen/CGExpr.cpp (working copy)</div><div>@@ -52,7 +52,9 @@</div><div> /// block.</div><div> llvm::AllocaInst *CodeGenFunction::CreateTempAlloca(llvm::Type *Ty,</div><div> const Twine &Name) {</div>
<div>- if (!Builder.isNamePreserving())</div><div>+ // AddressSanitizer and MemorySanitizer need temp names.</div><div>+ // FIXME: this may need a better solution, see PR17303.</div><div>+ if (!Builder.isNamePreserving() && !SanOpts->Address && !SanOpts->Memory)</div>
<div> return new llvm::AllocaInst(Ty, 0, "", AllocaInsertPt);</div><div> return new llvm::AllocaInst(Ty, 0, Name, AllocaInsertPt);</div><div> }</div></div><div><br></div><div><br></div><div>I did not find a way to test it in clang w/o depending on asan/msan.</div>
<div>If I do a lit test in test/CodeGen/ and invoke clang with -emit-llvm -fsanitize=address,</div><div>it actually runs the asan LLVM pass and only then emits IR.</div><div>Is there some standard way to output IR before it goes into optimizations? </div>
<div>I tried adding -disable-llvm-optzns (per Chandler's suggestion) -- did not help. </div><div>I'll make another test in compiler-rt anyway.</div><div><br></div><div><br></div><div>Thanks, </div><div>--kcc</div>
<div><br></div></div>