aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bytecode/Reader/Reader.h')
-rw-r--r--lib/Bytecode/Reader/Reader.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Bytecode/Reader/Reader.h b/lib/Bytecode/Reader/Reader.h
index 86ccc200a7..cba7154dbe 100644
--- a/lib/Bytecode/Reader/Reader.h
+++ b/lib/Bytecode/Reader/Reader.h
@@ -226,6 +226,18 @@ protected:
Function* F ///< The function into which BBs will be inserted
);
+ /// Convert previous opcode values into the current value and/or construct
+ /// 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(
+ 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
+ const Type* InstTy, ///< The type of the instruction
+ BasicBlock* BB ///< The basic block to insert into, if we need to
+ );
+
/// @brief Parse a single instruction.
void ParseInstruction(
std::vector<unsigned>& Args, ///< The arguments to be filled in
@@ -336,6 +348,13 @@ 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 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
/// to intrinsic functions, we save a mapping of old function definitions to