diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-02-25 09:54:52 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-02-25 09:54:52 +0000 |
commit | 404cb4f9fa2df50eac4d84b8a77c84a92188c6d5 (patch) | |
tree | baf5af33b59652d826500e5b0a678856c5ed5d68 /include/llvm/CodeGen/MachineInstr.h | |
parent | 05b53740e21ca0ce342f13b05c238134030420fb (diff) |
Added an offset field to ConstantPoolSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 4f09046b0e..b84388597a 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -131,7 +131,8 @@ private: // will be set for a value after reg allocation int offset; // Offset to address of global or external, only - // valid for MO_GlobalAddress and MO_ExternalSym + // valid for MO_GlobalAddress, MO_ExternalSym + // and MO_ConstantPoolIndex } extra; void zeroContents () { @@ -140,11 +141,14 @@ private: } MachineOperand(int64_t ImmVal = 0, - MachineOperandType OpTy = MO_VirtualRegister) + MachineOperandType OpTy = MO_VirtualRegister, int Offset = 0) : flags(0), opType(OpTy) { zeroContents (); contents.immedVal = ImmVal; - extra.regNum = -1; + if (OpTy == MachineOperand::MO_ConstantPoolIndex) + extra.offset = Offset; + else + extra.regNum = -1; } MachineOperand(int Reg, MachineOperandType OpTy, UseType UseTy) @@ -286,7 +290,7 @@ public: return (GlobalValue*)contents.value; } int getOffset() const { - assert((isGlobalAddress() || isExternalSymbol()) && + assert((isGlobalAddress() || isExternalSymbol() || isConstantPoolIndex()) && "Wrong MachineOperand accessor"); return extra.offset; } @@ -344,7 +348,7 @@ public: } void setOffset(int Offset) { - assert((isGlobalAddress() || isExternalSymbol()) && + assert((isGlobalAddress() || isExternalSymbol() || isConstantPoolIndex()) && "Wrong MachineOperand accessor"); extra.offset = Offset; } @@ -644,7 +648,7 @@ public: /// addConstantPoolndexOperand - Add a constant pool object index to the /// instruction. /// - void addConstantPoolIndexOperand(unsigned I) { + void addConstantPoolIndexOperand(unsigned I, int Offset=0) { assert(!OperandsComplete() && "Trying to add an operand to a machine instr that is already done!"); operands.push_back(MachineOperand(I, MachineOperand::MO_ConstantPoolIndex)); |