diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-01-26 08:10:24 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-01-26 08:10:24 +0000 |
commit | 675fb2301fa8b77e8d6d0b84be7a5799d1ab9b01 (patch) | |
tree | 316d703942646f812a9c646aa4cb7d1c8bd19485 /llvm/lib/Bytecode/Reader/Reader.cpp | |
parent | 6a8d4eab6a3cd3f2c2989f27e9a8e6ca94859b3a (diff) | |
download | bcm5719-llvm-675fb2301fa8b77e8d6d0b84be7a5799d1ab9b01.tar.gz bcm5719-llvm-675fb2301fa8b77e8d6d0b84be7a5799d1ab9b01.zip |
For PR761:
Remove the Endianness and PointerSize fields from the ModuleHeader and
replace it with the DataLayout field.
llvm-svn: 33529
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r-- | llvm/lib/Bytecode/Reader/Reader.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index efdb4f17d26..b94139482cd 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/lib/Bytecode/Reader/Reader.cpp @@ -2014,6 +2014,13 @@ void BytecodeReader::ParseModuleGlobalInfo() { if (Handler) Handler->handleTargetTriple(triple); + // Read the data layout string and place into the module. + std::string datalayout = read_str(); + TheModule->setDataLayout(datalayout); + // FIXME: Implement + // if (Handler) + // Handler->handleDataLayout(datalayout); + if (At != BlockEnd) { // If the file has section info in it, read the section names now. unsigned NumSections = read_vbr_uint(); @@ -2045,31 +2052,14 @@ void BytecodeReader::ParseModuleGlobalInfo() { /// Parse the version information and decode it by setting flags on the /// Reader that enable backward compatibility of the reader. void BytecodeReader::ParseVersionInfo() { - unsigned Version = read_vbr_uint(); - - // Unpack version number: low four bits are for flags, top bits = version - Module::Endianness Endianness; - Module::PointerSize PointerSize; - Endianness = (Version & 1) ? Module::BigEndian : Module::LittleEndian; - PointerSize = (Version & 2) ? Module::Pointer64 : Module::Pointer32; - - bool hasNoEndianness = Version & 4; - bool hasNoPointerSize = Version & 8; - - RevisionNum = Version >> 4; + unsigned RevisionNum = read_vbr_uint(); // We don't provide backwards compatibility in the Reader any more. To // upgrade, the user should use llvm-upgrade. if (RevisionNum < 7) error("Bytecode formats < 7 are no longer supported. Use llvm-upgrade."); - if (hasNoEndianness) Endianness = Module::AnyEndianness; - if (hasNoPointerSize) PointerSize = Module::AnyPointerSize; - - TheModule->setEndianness(Endianness); - TheModule->setPointerSize(PointerSize); - - if (Handler) Handler->handleVersionInfo(RevisionNum, Endianness, PointerSize); + if (Handler) Handler->handleVersionInfo(RevisionNum); } /// Parse a whole module. |