Hi LLVM-ers,<br><br>I am trying to get a return type of a function(from bitcode file) with LLVM-C API, but there seems no appropriate API to do that.<br><br>I've tried to do that with following code,<br><br>----<br><br>
LLVMModuleRef M;<br>LLVMMemoryBufferRef MemBuf;<br>LLVMValueRef F; // Function<br>LLVMTypeRef RetTy; <br>char *ErrStr;<br><br>//<br>// -- Load shader module<br>
//<br>ret = LLVMCreateMemoryBufferWithContentsOfFile(<br> input,<br> &MemBuf, // [out]<br> &ErrStr); // [out]<br><br>ret = LLVMParseBitcode(<br> MemBuf,<br> &M, // [out]<br>
&ErrStr); // [out]<br><br>F = LLVMGetFirstFunction(M);<br><br>RetTy = LLVMGetReturnType(F); // NG! Can't do this<br><br>----<br><br>How can I do that? <br>(I am using HEAD version of llvm)<br><br>And is there a tutorial or document for LLVM C API?<br>
<br><br>Thanks in advance.