summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-10-18 17:19:20 +0000
committerChris Lattner <sabre@nondot.org>2004-10-18 17:19:20 +0000
commit4caf5d563d0e5e6a2ed56bb537cb911d99beaa4c (patch)
tree1d35613697ff8f00d41a1931233fc842752a24a8 /include/llvm/CodeGen
parent7d0974b9a07aea5488d8123c6df6d79f1b40bc40 (diff)
downloadllvm-4caf5d563d0e5e6a2ed56bb537cb911d99beaa4c.tar.gz
llvm-4caf5d563d0e5e6a2ed56bb537cb911d99beaa4c.tar.bz2
llvm-4caf5d563d0e5e6a2ed56bb537cb911d99beaa4c.tar.xz
Fix miscompilations in the SparcV9 backend that were induced by this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20041011/019311.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/MachineInstr.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index d23252e5b8..d9a865e0a6 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -153,10 +153,20 @@ private:
}
MachineOperand(Value *V, MachineOperandType OpTy, UseType UseTy,
+ bool isPCRelative = false)
+ : flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) {
+ assert(OpTy != MachineOperand::MO_GlobalAddress);
+ zeroContents();
+ contents.value = V;
+ extra.regNum = -1;
+ }
+
+ MachineOperand(GlobalValue *V, MachineOperandType OpTy, UseType UseTy,
bool isPCRelative = false, int Offset = 0)
: flags(UseTy | (isPCRelative?PCRELATIVE:0)), opType(OpTy) {
+ assert(OpTy == MachineOperand::MO_GlobalAddress);
zeroContents ();
- contents.value = V;
+ contents.value = (Value*)V;
extra.offset = Offset;
}
@@ -642,7 +652,7 @@ public:
assert(!OperandsComplete() &&
"Trying to add an operand to a machine instr that is already done!");
operands.push_back(
- MachineOperand((Value*)GV, MachineOperand::MO_GlobalAddress,
+ MachineOperand(GV, MachineOperand::MO_GlobalAddress,
MachineOperand::Use, isPCRelative, Offset));
}