Hi! I have this error while building my code: Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a bad signature!") Actually I'm trying to load functions from .bc file and use them in the code that I'm building with IRBuilder. I found that function parameter type is %struct.reValue* and the type of the value that I'm passing to the function is {i32,i64}* But these types are quite equivalent, because of the definition: %struct.reValue = type { %"struct.reValue::$_44", %"struct.reValue::$_46" } %"struct.reValue::$_44" = type { i32 } %"struct.reValue::$_46" = type { i64 } What is the easiest way to solve this problem? Thanks, Andrii
Hi Andrii-- They're not equivalent as far as LLVM is concerned - the parameter type is { { i32 }. { i64 } }* whereas the function is being given a { i32, i64 }*. Probably the easiest way to work around this is a simple bitcast. Alastair On 7 Sep 2009, at 00:32, Andrii Vasyliev wrote:> Hi! > > I have this error while building my code: > Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) > == Params[i]->getType()) && "Calling a function with a bad > signature!") > Actually I'm trying to load functions from .bc file and use them in > the code that I'm building with IRBuilder. > > I found that function parameter type is %struct.reValue* and > the type of the value that I'm passing to the function is {i32,i64}* > > But these types are quite equivalent, because of the definition: > %struct.reValue = type { %"struct.reValue::$_44", > %"struct.reValue::$_46" } > %"struct.reValue::$_44" = type { i32 } > %"struct.reValue::$_46" = type { i64 } > > What is the easiest way to solve this problem? > > Thanks, > Andrii > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3912 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090907/c035cfb0/attachment.bin>
Andrii Vasyliev wrote:> Hi! > > I have this error while building my code: > Assertion failed: ((i >= FTy->getNumParams() || FTy->getParamType(i) > == Params[i]->getType()) && "Calling a function with a bad > signature!") > Actually I'm trying to load functions from .bc file and use them in > the code that I'm building with IRBuilder. > > I found that function parameter type is %struct.reValue* and > the type of the value that I'm passing to the function is {i32,i64}* > > But these types are quite equivalent, because of the definition: > %struct.reValue = type { %"struct.reValue::$_44", > %"struct.reValue::$_46" } > %"struct.reValue::$_44" = type { i32 } > %"struct.reValue::$_46" = type { i64 }Not quite. %struct.reValue = type { { i32 }, { i64 } } not { i32, i64 }. Nick