Allow modules to have 'any' pointer size and endianness. Luckily, we had

some space for extra flags, so we don't need to bump the revision number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-08-24 13:47:36 +00:00
parent a7a35a831b
commit d445c6b64a
3 changed files with 26 additions and 15 deletions

View File

@ -43,11 +43,14 @@ BytecodeWriter::BytecodeWriter(std::deque<unsigned char> &o, const Module *M)
// Emit the top level CLASS block.
BytecodeBlock ModuleBlock(BytecodeFormat::Module, Out);
bool isBigEndian = M->isBigEndian();
bool hasLongPointers = M->has64BitPointers();
bool isBigEndian = M->getEndianness() == Module::BigEndian;
bool hasLongPointers = M->getPointerSize() == Module::Pointer64;
bool hasNoEndianness = M->getEndianness() == Module::AnyEndianness;
bool hasNoPointerSize = M->getPointerSize() == Module::AnyPointerSize;
// Output the version identifier... we are currently on bytecode version #2
unsigned Version = (2 << 4) | isBigEndian | (hasLongPointers << 1);
unsigned Version = (2 << 4) | isBigEndian | (hasLongPointers << 1) |
(hasNoEndianness << 2) | (hasNoPointerSize << 3);
output_vbr(Version, Out);
align32(Out);