summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-24 13:47:36 +0000
committerChris Lattner <sabre@nondot.org>2003-08-24 13:47:36 +0000
commit55a07adc36099688e2ab908478a3adbd82509755 (patch)
tree6b582411298ead9199d7ee645c8758d44af19c82 /llvm/lib/Bytecode/Writer/Writer.cpp
parentfc5aa1c93ca5523980516fa55f0ce85545171303 (diff)
downloadbcm5719-llvm-55a07adc36099688e2ab908478a3adbd82509755.tar.gz
bcm5719-llvm-55a07adc36099688e2ab908478a3adbd82509755.zip
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. llvm-svn: 8118
Diffstat (limited to 'llvm/lib/Bytecode/Writer/Writer.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index f8d94890f06..096dc69895c 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -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);
OpenPOWER on IntegriCloud