[llvm] r273795 - [RSForGC] Bring containsGCPtrType, isGCPointerType up to code; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 25 21:55:20 PDT 2016


Author: sanjoy
Date: Sat Jun 25 23:55:19 2016
New Revision: 273795

URL: http://llvm.org/viewvc/llvm-project?rev=273795&view=rev
Log:
[RSForGC] Bring containsGCPtrType, isGCPointerType up to code; NFC

Modified:
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=273795&r1=273794&r2=273795&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Sat Jun 25 23:55:19 2016
@@ -219,7 +219,7 @@ static bool isGCPointerType(Type *T) {
     // For the sake of this example GC, we arbitrarily pick addrspace(1) as our
     // GC managed heap.  We know that a pointer into this heap needs to be
     // updated and that no other pointer does.
-    return (1 == PT->getAddressSpace());
+    return PT->getAddressSpace() == 1;
   return false;
 }
 
@@ -250,8 +250,7 @@ static bool containsGCPtrType(Type *Ty)
   if (ArrayType *AT = dyn_cast<ArrayType>(Ty))
     return containsGCPtrType(AT->getElementType());
   if (StructType *ST = dyn_cast<StructType>(Ty))
-    return std::any_of(ST->subtypes().begin(), ST->subtypes().end(),
-                       containsGCPtrType);
+    return any_of(ST->subtypes(), containsGCPtrType);
   return false;
 }
 




More information about the llvm-commits mailing list