[llvm-commits] [llvm] r94835 - /llvm/trunk/lib/Transforms/Utils/Local.cpp

Bob Wilson bob.wilson at apple.com
Fri Jan 29 12:34:28 PST 2010


Author: bwilson
Date: Fri Jan 29 14:34:28 2010
New Revision: 94835

URL: http://llvm.org/viewvc/llvm-project?rev=94835&view=rev
Log:
Use uint64_t instead of unsigned for offsets and sizes.

Modified:
    llvm/trunk/lib/Transforms/Utils/Local.cpp

Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=94835&r1=94834&r2=94835&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Fri Jan 29 14:34:28 2010
@@ -44,7 +44,7 @@
 /// This is closely related to Value::getUnderlyingObject but is located
 /// here to avoid making VMCore depend on TargetData.
 static Value *getUnderlyingObjectWithOffset(Value *V, const TargetData *TD,
-                                            unsigned &ByteOffset,
+                                            uint64_t &ByteOffset,
                                             unsigned MaxLookup = 6) {
   if (!isa<PointerType>(V->getType()))
     return V;
@@ -76,7 +76,7 @@
 /// ScanFrom, to determine if the address is already accessed.
 bool llvm::isSafeToLoadUnconditionally(Value *V, Instruction *ScanFrom,
                                        const TargetData *TD) {
-  unsigned ByteOffset = 0;
+  uint64_t ByteOffset = 0;
   Value *Base = V;
   if (TD)
     Base = getUnderlyingObjectWithOffset(V, TD, ByteOffset);
@@ -98,7 +98,7 @@
     if (BaseType->isSized()) {
       // Check if the load is within the bounds of the underlying object.
       const PointerType *AddrTy = cast<PointerType>(V->getType());
-      unsigned LoadSize = TD->getTypeStoreSize(AddrTy->getElementType());
+      uint64_t LoadSize = TD->getTypeStoreSize(AddrTy->getElementType());
       if (ByteOffset + LoadSize <= TD->getTypeAllocSize(BaseType))
         return true;
     }





More information about the llvm-commits mailing list