<div dir="ltr">Thanks for your patience. I've committed a patch based on this in r247047 (you can see the sort of test case I was referring to in that commit, if you're interested)<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 7, 2015 at 5:16 AM, JEROME WITMANN via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-AU" link="blue" vlink="purple">
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Patch to add the missing type to the CppBackend.<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black">In LLVM 3.7.0, GetElementPtrInst::Create requires the type to be passed and the target CppBackend doesn't do so.<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><u></u> <u></u></span></p>
<pre style="background:white"><span style="color:black">The test case is rather easy, any array access will do it:<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black"><u></u> <u></u></span></pre>
<pre style="background:white"><span style="color:black">void test(char *str, int idx)<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black">{<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black"> str[idx]=idx;<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black">}<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black"><u></u> <u></u></span></pre>
<pre style="background:white"><span style="color:black">clang -emit-llvm -c test.c -o tmp.bc<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black">llc -march=cpp tmp.bc -o output.cpp<u></u><u></u></span></pre>
<pre style="background:white"><span style="color:black"><u></u> <u></u></span></pre>
<pre style="background:white"><span style="color:black">In the output.cpp, the GetElementPtrInst::Create() will be missing the Pointer type (1st param). The attached patch resolve the issue... or at least it attempts to do so.<u></u><u></u></span></pre>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Also in Bugzilla as bug 24689.<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:black">Jerome<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt"><u></u> <u></u></span></p>
</div>
</div>

<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>