Hi,
I'm changing bytecode format a little bit, i.e. for 2 operands
Instructions, the original is like this:
01-00:Opcode type
07-02:Opcode
15-08: Instruction type
23-16: Operand#1
31-24: Operand#2
My change is like this:
01-00:Opcode type
07-02:Opcode
15-08: Instruction type
16: myflag1
17: myflag2
24-18: Operand#1
31-25: Operand#2
I do the corresponding changes in both Writer.cpp and Reader.cpp.But
when I compile, errors take place when "linking comp_genericeh.bc
component..". comp_genericeh.bc is some bytecode in
/runtime/GCCLibrary.
I wonder is it because the comp_genericeh.bc is produced by orignal
bytecode format so that the changed bytecode read& write lib cann't
encode and decode it correctly?
--
Shuhan
Yes, that's right. If you change the bytecode format, you need to rebuild your LLVM tree (which will rebuild the runtime libraries), and then reinstall the libraries. To do this, run make -C runtime install-bytecode from your LLVM object directory. Rob On Sep 9, 2005, at 11:19 AM, shding at mtu.edu wrote:> Hi, > I'm changing bytecode format a little bit, i.e. for 2 operands > Instructions, the original is like this: > 01-00:Opcode type > 07-02:Opcode > 15-08: Instruction type > 23-16: Operand#1 > 31-24: Operand#2 > My change is like this: > 01-00:Opcode type > 07-02:Opcode > 15-08: Instruction type > 16: myflag1 > 17: myflag2 > 24-18: Operand#1 > 31-25: Operand#2 > I do the corresponding changes in both Writer.cpp and > Reader.cpp.But > when I compile, errors take place when "linking comp_genericeh.bc > component..". comp_genericeh.bc is some bytecode in > /runtime/GCCLibrary. > I wonder is it because the comp_genericeh.bc is produced by orignal > bytecode format so that the changed bytecode read& write lib cann't > encode and decode it correctly? > > -- > Shuhan > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >Robert L. Bocchino Jr. Ph.D. Student, Computer Science University of Illinois, Urbana-Champaign -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1444 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050909/67d33606/attachment.bin>
On Fri, 9 Sep 2005 shding at mtu.edu wrote:> Hi, > I'm changing bytecode format a little bit, i.e. for 2 operands > Instructions, the original is like this: > 01-00:Opcode type > 07-02:Opcode > 15-08: Instruction type > 23-16: Operand#1 > 31-24: Operand#2 > My change is like this: > 01-00:Opcode type > 07-02:Opcode > 15-08: Instruction type > 16: myflag1 > 17: myflag2 > 24-18: Operand#1 > 31-25: Operand#2 > I do the corresponding changes in both Writer.cpp and Reader.cpp.But > when I compile, errors take place when "linking comp_genericeh.bc > component..". comp_genericeh.bc is some bytecode in > /runtime/GCCLibrary. > I wonder is it because the comp_genericeh.bc is produced by orignal > bytecode format so that the changed bytecode read& write lib cann't > encode and decode it correctly?Yup, that's the problem. The best way to handle this is invent a new bytecode version number, and parse the old format when reading a .bc file older than the current version. This is how we handle backwards compatibility when we change the .bc format. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Reasonably Related Threads
- [LLVMdev] how to pass message from LLVM IR to bachend code
- [LLVMdev] Building the llvm runtime: 'Can't destroy file: The process cannot access the fi
- [LLVMdev] how to pass message from LLVM IR to bachend code
- [LLVMdev] bytecode version
- [LLVMdev] Building llvm and cfrontend under cygwin