diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-08 21:27:54 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-08 21:27:54 +0000 |
commit | 6996feb77e7506647ba4a16c55ccc7d95f87b804 (patch) | |
tree | e2c335f2da7a19a837b155b3351d0bb2f66292f9 /lib/Bytecode/Reader/Reader.h | |
parent | aacf99964f6f37d566f9fda5160b3826f3ce2da4 (diff) |
Bump the bytecode version number to 7. Implement upgrade of version 6 and
version 6 bytecode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31573 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Reader/Reader.h')
-rw-r--r-- | lib/Bytecode/Reader/Reader.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/Bytecode/Reader/Reader.h b/lib/Bytecode/Reader/Reader.h index cba7154dbe..b03e8e688c 100644 --- a/lib/Bytecode/Reader/Reader.h +++ b/lib/Bytecode/Reader/Reader.h @@ -230,7 +230,7 @@ protected: /// the instruction. This function handles all *abnormal* cases for /// instruction generation based on obsolete opcode values. The normal cases /// are handled by the ParseInstruction function. - Instruction* handleObsoleteOpcodes( + Instruction* upgradeInstrOpcodes( unsigned &opcode, ///< The old opcode, possibly updated by this function std::vector<unsigned> &Oprnds, ///< The operands to the instruction unsigned &iType, ///< The type code from the bytecode file @@ -238,6 +238,13 @@ protected: BasicBlock* BB ///< The basic block to insert into, if we need to ); + /// @brief Convert previous opcode values for ConstantExpr into the current + /// value. + unsigned upgradeCEOpcodes( + unsigned Opcode, ///< Opcode read from bytecode + const std::vector<Constant*> &ArgVec ///< Arguments of instruction + ); + /// @brief Parse a single instruction. void ParseInstruction( std::vector<unsigned>& Args, ///< The arguments to be filled in @@ -348,12 +355,15 @@ private: // unreachable instruction. bool hasNoUnreachableInst; - // In version 5 and prior, instructions were signless. In version 6, - // instructions became signed. For example in version 5 we have the DIV - // instruction but in version 6 we have FDIV, SDIV and UDIV to replace it. - // This causes a renumbering of the instruction codes in version 6 that must - // be dealt with when reading old bytecode files. - bool hasSignlessInstructions; + // In version 6, the Div and Rem instructions were converted to be the + // signed instructions UDiv, SDiv, URem and SRem. This flag will be true if + // the Div and Rem instructions are signless (ver 5 and prior). + bool hasSignlessDivRem; + + // In version 7, the Shr, Cast and Setcc instructions changed to their + // signed counterparts. This flag will be true if these instructions are + // signless (version 6 and prior). + bool hasSignlessShrCastSetcc; /// In release 1.7 we changed intrinsic functions to not be overloaded. There /// is no bytecode change for this, but to optimize the auto-upgrade of calls |