aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Reader/Reader.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-10-26 06:15:43 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-10-26 06:15:43 +0000
commit1628cec4d7fce310d9cde0bcc73997e5a71692c4 (patch)
tree6dff5a70de8406b153e32fdd2d60c782d6202f63 /lib/Bytecode/Reader/Reader.h
parent7043d00750c558a518d08a638638ebe4d241f159 (diff)
For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
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