[llvm-branch-commits] [llvm-gcc-branch] r137155 - /llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-types.cpp

Eric Christopher echristo at apple.com
Tue Aug 9 14:45:46 PDT 2011


Author: echristo
Date: Tue Aug  9 16:45:45 2011
New Revision: 137155

URL: http://llvm.org/viewvc/llvm-project?rev=137155&view=rev
Log:
Merge from mainline:

r111694 | echristo | 2010-08-20 16:08:36 -0700 (Fri, 20 Aug 2010) | 2 lines

Fix redefinition of Ty per C++ [stmt.select] p3.


Modified:
    llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-types.cpp

Modified: llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-types.cpp?rev=137155&r1=137154&r2=137155&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Morbo/gcc/llvm-types.cpp Tue Aug  9 16:45:45 2011
@@ -789,18 +789,18 @@
   case POINTER_TYPE:
   case REFERENCE_TYPE:
   case BLOCK_POINTER_TYPE:
-    if (const PointerType *Ty = cast_or_null<PointerType>(GET_TYPE_LLVM(type))){
+    if (const PointerType *PTy = cast_or_null<PointerType>(GET_TYPE_LLVM(type))){
       // We already converted this type.  If this isn't a case where we have to
       // reparse it, just return it.
       if (PointersToReresolve.empty() || PointersToReresolve.back() != type ||
           ConvertingStruct)
-        return Ty;
+        return PTy;
       
       // Okay, we know that we're !ConvertingStruct and that type is on the end
       // of the vector.  Remove this entry from the PointersToReresolve list and
       // get the pointee type.  Note that this order is important in case the
       // pointee type uses this pointer.
-      assert(Ty->getElementType()->isOpaqueTy() && "Not a deferred ref!");
+      assert(PTy->getElementType()->isOpaqueTy() && "Not a deferred ref!");
       
       // We are actively resolving this pointer.  We want to pop this value from
       // the stack, as we are no longer resolving it.  However, we don't want to
@@ -815,7 +815,7 @@
       
       // Note that we know that Ty cannot be resolved or invalidated here.
       const Type *Actual = ConvertType(TREE_TYPE(type));
-      assert(GET_TYPE_LLVM(type) == Ty && "Pointer invalidated!");
+      assert(GET_TYPE_LLVM(type) == PTy && "Pointer invalidated!");
 
       // Restore ConvertingStruct for the caller.
       ConvertingStruct = false;
@@ -824,7 +824,7 @@
         Actual = Type::getInt8Ty(Context);  // void* -> sbyte*
       
       // Update the type, potentially updating TYPE_LLVM(type).
-      const OpaqueType *OT = cast<OpaqueType>(Ty->getElementType());
+      const OpaqueType *OT = cast<OpaqueType>(PTy->getElementType());
       const_cast<OpaqueType*>(OT)->refineAbstractTypeTo(Actual);
       return GET_TYPE_LLVM(type);
     } else {





More information about the llvm-branch-commits mailing list