Hi, I am generating the .bc file using the following command $ llvm-gcc -emit-llvm -S -o pointer.bc ../../../test/pointer.c But when I run any pass using opt it gives the following error : $ ./opt -basicaa pointer.bc ./opt: Bitcode stream should be a multiple of 4 bytes in length Is there something wrong with the way I generate the .bc file ? Thanks Pranav -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100416/0e0bc371/attachment.html>
Pranav Garg wrote:> Hi, > > I am generating the .bc file using the following command > > $ llvm-gcc -emit-llvm -S -o pointer.bc ../../../test/pointer.c > > But when I run any pass using opt it gives the following error : > $ ./opt -basicaa pointer.bc > ./opt: Bitcode stream should be a multiple of 4 bytes in length > > Is there something wrong with the way I generate the .bc file ?Based on those flags you should have a text file. Pass -c instead of -S, or use llvm-as to turn your file (which is actually better named pointer.bc) into a .bc file. Nick
On 4/16/10 12:17 AM, Nick Lewycky wrote:> Pranav Garg wrote: >> Hi, >> >> I am generating the .bc file using the following command >> >> $ llvm-gcc -emit-llvm -S -o pointer.bc ../../../test/pointer.c >> >> But when I run any pass using opt it gives the following error : >> $ ./opt -basicaa pointer.bc >> ./opt: Bitcode stream should be a multiple of 4 bytes in length >> >> Is there something wrong with the way I generate the .bc file ? > > Based on those flags you should have a text file. Pass -c instead of -S, > or use llvm-as to turn your file (which is actually better named > pointer.bc) into a .bc file.Don't you mean 'pointer.ll'? Chip
On Apr 15, 2010, at 11:11 PM, Pranav Garg wrote:> > ./opt: Bitcode stream should be a multiple of 4 bytes in lengthOthers have answered your question, but I'd also like to point out a fun feature of LLVM 2.7: opt now auto-detects and automatically handles LLVM IR assembly. Dan