[llvm-commits] CVS: llvm/tools/lli/ExecutionEngine.cpp

Chris Lattner lattner at cs.uiuc.edu
Mon Aug 18 12:24:02 PDT 2003


Changes in directory llvm/tools/lli:

ExecutionEngine.cpp updated: 1.19 -> 1.20

---
Log message:

Add support for casting any pointer to any integer type


---
Diffs of the changes:

Index: llvm/tools/lli/ExecutionEngine.cpp
diff -u llvm/tools/lli/ExecutionEngine.cpp:1.19 llvm/tools/lli/ExecutionEngine.cpp:1.20
--- llvm/tools/lli/ExecutionEngine.cpp:1.19	Wed Aug 13 13:16:14 2003
+++ llvm/tools/lli/ExecutionEngine.cpp	Mon Aug 18 12:23:40 2003
@@ -54,13 +54,15 @@
       if (Op->getType()->getPrimitiveID() == C->getType()->getPrimitiveID())
         return getConstantValue(Op);
 
-      // Handle cast of long to pointer or pointer to long...
-      if ((isa<PointerType>(Op->getType()) && (C->getType() == Type::LongTy ||
-                                               C->getType() == Type::ULongTy))||
-          (isa<PointerType>(C->getType()) && (Op->getType() == Type::LongTy ||
-                                              Op->getType() == Type::ULongTy))){
+      // Handle a cast of pointer to any integral type...
+      if (isa<PointerType>(Op->getType()) &&
+          (C->getType() == Type::LongTy || C->getType() == Type::ULongTy))
+        return getConstantValue(Op);
+        
+      // Handle cast of long to pointer...
+      if (isa<PointerType>(C->getType()) && (Op->getType() == Type::LongTy ||
+                                             Op->getType() == Type::ULongTy))
         return getConstantValue(Op);
-      }
       break;
     }
 





More information about the llvm-commits mailing list