[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed Nov 5 14:38:02 PST 2003


Changes in directory llvm/lib/Transforms/Utils:

Linker.cpp updated: 1.61 -> 1.62

---
Log message:

Further fixes for PR93


---
Diffs of the changes:  (+7 -1)

Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.61 llvm/lib/Transforms/Utils/Linker.cpp:1.62
--- llvm/lib/Transforms/Utils/Linker.cpp:1.61	Tue Nov  4 09:22:26 2003
+++ llvm/lib/Transforms/Utils/Linker.cpp	Wed Nov  5 14:37:01 2003
@@ -318,13 +318,19 @@
         assert(CE->getOpcode() == Instruction::Cast);
         Value *V = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
         Result = ConstantExpr::getCast(cast<Constant>(V), CE->getType());
+      } else if (CE->getOpcode() == Instruction::Shl ||
+                 CE->getOpcode() == Instruction::Shr) {      // Shift
+        Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
+        Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
+        Result = ConstantExpr::getShift(CE->getOpcode(), cast<Constant>(V1),
+                                        cast<Constant>(V2));
       } else if (CE->getNumOperands() == 2) {
         // Binary operator...
         Value *V1 = RemapOperand(CE->getOperand(0), LocalMap, GlobalMap);
         Value *V2 = RemapOperand(CE->getOperand(1), LocalMap, GlobalMap);
 
         Result = ConstantExpr::get(CE->getOpcode(), cast<Constant>(V1),
-                                   cast<Constant>(V2));        
+                                   cast<Constant>(V2));
       } else {
         assert(0 && "Unknown constant expr type!");
       }





More information about the llvm-commits mailing list