Rekha R
2013-Oct-08 16:53 UTC
[LLVMdev] C constructs to generate some of LLVM IR instructions?
Hi, I was studying the LLVM IR instruction set by analyzing how constructs in C language is getting converted to IR form. I found difficulty in finding C constructs which could generate Invoke, Resume, Unreachable, ExtractValue, InsertValue instructions. Can someone help me find some simple C code that generates these instructions in LLVM IR? -- Regards, Rekha -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131008/3148c473/attachment.html>
Eli Bendersky
2013-Oct-08 17:33 UTC
[LLVMdev] C constructs to generate some of LLVM IR instructions?
On Tue, Oct 8, 2013 at 9:53 AM, Rekha R <rekharamapai at nitc.ac.in> wrote:> Hi, > > I was studying the LLVM IR instruction set by analyzing how constructs in > C language is getting converted to IR form. > > I found difficulty in finding C constructs which could generate Invoke, > Resume, Unreachable, ExtractValue, InsertValue instructions. Can someone > help me find some simple C code that generates these instructions in LLVM > IR? >A great way to find such information is search in the tests directory of clang. So if you have clang checked out into the LLVM tree, run a recursive grep over all C files in 'tools/clang/tests' Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131008/7d188b16/attachment.html>
James Courtier-Dutton
2013-Oct-09 09:23 UTC
[LLVMdev] C constructs to generate some of LLVM IR instructions?
On 8 October 2013 17:53, Rekha R <rekharamapai at nitc.ac.in> wrote:> Hi, > > I was studying the LLVM IR instruction set by analyzing how constructs in > C language is getting converted to IR form. > > I found difficulty in finding C constructs which could generate Invoke, > Resume, Unreachable, ExtractValue, InsertValue instructions. Can someone > help me find some simple C code that generates these instructions in LLVM > IR? > >I have attempted to use the C API to LLVM in the past, and I have found that it does not always expose all the features one might need. For my project I used the C++ API to LLVM and then created my own C API to it. I am only talking as a user, and not an LLVM developer. That combined with the clang -march=cpp feature makes using the C++ API to create LLVM IR a lot easier. James -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131009/57a898c7/attachment.html>