[LLVMbugs] [Bug 184] NEW: [bcreader/writer] include/llvm/Bytecode/Primitives.h should be cleaned up
bugzilla-daemon at zion.cs.uiuc.edu
bugzilla-daemon at zion.cs.uiuc.edu
Sun Dec 14 22:55:38 PST 2003
http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=184
Summary: [bcreader/writer] include/llvm/Bytecode/Primitives.h
should be cleaned up
Product: libraries
Version: 1.0
Platform: All
OS/Version: All
Status: NEW
Severity: minor
Priority: P2
Component: Bytecode Reader
AssignedTo: sabre at nondot.org
ReportedBy: sabre at nondot.org
include/llvm/Bytecode/Primitives.h is a gross hack that desperately needs to be
cleaned up. In particular, at least the following should be done:
1. The file should be split into two distinct pieces (one for the reader,
one for the writer) and the pieces should be moved into lib/Bytecode/*
2. The reader stuff should throw exceptions on errors, so that the bytecode
reader doesn't have to transform the true/false return codes into exceptions.
This will likely also make the code more efficient, and making the bytecode
reader as efficient as possible is a high priority for LLVM.
3. Using a deque<unsigned char> to accumulate the bytecode file in the writer
is pretty gross, and certainly has to be inefficient. A custom container
should be implemented for this, because we really only need "append with
backpatching" support.
4. Instead of conditionally compiling the code based on endianness, it seems
to make sense to use the network byte order functions to do byteswapping
for us. The only problem is that LLVM bytecode files are not in network
byte order (big endian) they are little endian.
-Chris
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
More information about the llvm-bugs
mailing list