tag:blogger.com,1999:blog-8477445975588753706.post4748151299482435232..comments2023-10-11T03:45:48.420-07:00Comments on Standards: LLVM For Startersujmhttp://www.blogger.com/profile/08682772434896813808noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-8477445975588753706.post-34893548144074751692012-12-12T04:18:17.810-08:002012-12-12T04:18:17.810-08:00Right, sorry i was not clear i think or maybe sugg...Right, sorry i was not clear i think or maybe suggested a wrong update. Diff against version above:<br /><br />38c38<br />< declare i32 (i8*, ...)* @printf(i8*, ...) nounwind<br />---<br />> declare i32 @printf(i8*, ...) nounwind<br /><br />In other words: the (i8*, ...)* signature must only be added to the 'call' OP, not the 'declare' part.<br /><br />lli fib.ll works for me this way, regards.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8477445975588753706.post-53539663447977191822012-09-26T11:40:48.710-07:002012-09-26T11:40:48.710-07:00I get the following error when using llvm-as
fibo...I get the following error when using llvm-as<br /><br />fibonacci.ll:10:24: error: invalid forward reference to function 'printf' with wrong type!<br /> call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @str, i32 0, i32 0), i32 %fib)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8477445975588753706.post-63904909703398100092012-09-02T23:41:51.690-07:002012-09-02T23:41:51.690-07:00Thanks! I changed them now.Thanks! I changed them now.ujmhttps://www.blogger.com/profile/08682772434896813808noreply@blogger.comtag:blogger.com,1999:blog-8477445975588753706.post-50421595031414789852012-08-09T13:32:41.735-07:002012-08-09T13:32:41.735-07:00update for latest llvm: change the printf call lin...update for latest llvm: change the printf call line to:<br /> call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8]* @str, i32 0, i32 0), i32 %fib)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8477445975588753706.post-75417984648102276282012-07-13T03:15:31.663-07:002012-07-13T03:15:31.663-07:00I could fix it like this on llvm-3.1:
%cast = ge...I could fix it like this on llvm-3.1:<br /> %cast = getelementptr [4 x i8]* @str, i32 0, i32 0<br /> call i32 (i8*, ...)* @printf( i8* %cast, i32 %fib)<br /><br />It should work without the cast tmpvar, but the extended type after "call" is necessary.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8477445975588753706.post-33027213486180002402012-02-01T11:24:40.866-08:002012-02-01T11:24:40.866-08:00You're welcome. I found that the example code ...You're welcome. I found that the example code didn't work with the latest version of llvm. I'll write a new entry later.ujmhttps://www.blogger.com/profile/08682772434896813808noreply@blogger.comtag:blogger.com,1999:blog-8477445975588753706.post-83782490523089342122012-01-30T13:46:25.899-08:002012-01-30T13:46:25.899-08:00Thank you! I was looking for a very simple example...Thank you! I was looking for a very simple example and that's exactly what you provided.Anonymousnoreply@blogger.com