Fix the X86 addConstantPoolReference, which had the operands in the wrong order.
authorOwen Anderson <resistor@mac.com>
Sat, 6 Sep 2008 00:50:00 +0000 (00:50 +0000)
committerOwen Anderson <resistor@mac.com>
Sat, 6 Sep 2008 00:50:00 +0000 (00:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55867 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrBuilder.h

index 428f24ec56f9d87ce30a1b9b49df0e6c96c2d629..d4e10bbb50e5eaf7f5186515378af7f5fdc188b9 100644 (file)
@@ -121,7 +121,8 @@ addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0) {
 inline const MachineInstrBuilder &
 addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
                          int Offset = 0) {
-  return MIB.addConstantPoolIndex(CPI).addImm(1).addReg(0).addImm(Offset);
+  assert(Offset == 0 && "Non-zero offsets not supported!");
+  return MIB.addReg(0).addImm(1).addReg(0).addConstantPoolIndex(CPI);
 }
 
 } // End llvm namespace