[PATCH] CppBackend needs to be updated to handle new GetElementPtrInst::Create prototype

JEROME WITMANN via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 05:16:14 PDT 2015


Patch to add the missing type to the CppBackend.

In LLVM 3.7.0, GetElementPtrInst::Create requires the type to be passed and the target CppBackend doesn't do so.


The test case is rather easy, any array access will do it:



void test(char *str, int idx)

{

 str[idx]=idx;

}



clang -emit-llvm -c test.c -o tmp.bc

llc -march=cpp tmp.bc -o output.cpp



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.

Also in Bugzilla as bug 24689.

Thanks,
Jerome

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150907/dfb7557e/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_cppbackend.txt
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150907/dfb7557e/attachment.txt>


More information about the llvm-commits mailing list