[llvm] r264129 - [StatepointLowering] Minor NFC cleanups

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 19:24:13 PDT 2016


Author: sanjoy
Date: Tue Mar 22 21:24:13 2016
New Revision: 264129

URL: http://llvm.org/viewvc/llvm-project?rev=264129&view=rev
Log:
[StatepointLowering] Minor NFC cleanups

 - Use auto
 - Name variables in LLVM style
 - Use llvm::find instead of std::find
 - Blank lines between declarations

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h?rev=264129&r1=264128&r2=264129&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.h Tue Mar 22 21:24:13 2016
@@ -46,15 +46,16 @@ public:
   /// statepoint.  Will return SDValue() if this value hasn't been
   /// spilled.  Otherwise, the value has already been spilled and no
   /// further action is required by the caller.
-  SDValue getLocation(SDValue val) {
-    if (!Locations.count(val))
+  SDValue getLocation(SDValue Val) {
+    if (!Locations.count(Val))
       return SDValue();
-    return Locations[val];
+    return Locations[Val];
   }
-  void setLocation(SDValue val, SDValue Location) {
-    assert(!Locations.count(val) &&
+
+  void setLocation(SDValue Val, SDValue Location) {
+    assert(!Locations.count(Val) &&
            "Trying to allocate already allocated location");
-    Locations[val] = Location;
+    Locations[Val] = Location;
   }
 
   /// Record the fact that we expect to encounter a given gc_relocate
@@ -63,16 +64,15 @@ public:
   void scheduleRelocCall(const CallInst &RelocCall) {
     PendingGCRelocateCalls.push_back(&RelocCall);
   }
+
   /// Remove this gc_relocate from the list we're expecting to see
   /// before the next statepoint.  If we weren't expecting to see
   /// it, we'll report an assertion.
   void relocCallVisited(const CallInst &RelocCall) {
-    SmallVectorImpl<const CallInst *>::iterator itr =
-        std::find(PendingGCRelocateCalls.begin(), PendingGCRelocateCalls.end(),
-                  &RelocCall);
-    assert(itr != PendingGCRelocateCalls.end() &&
+    auto I = find(PendingGCRelocateCalls, &RelocCall);
+    assert(I != PendingGCRelocateCalls.end() &&
            "Visited unexpected gcrelocate call");
-    PendingGCRelocateCalls.erase(itr);
+    PendingGCRelocateCalls.erase(I);
   }
 
   // TODO: Should add consistency tracking to ensure we encounter
@@ -89,6 +89,7 @@ public:
     assert(NextSlotToAllocate <= (unsigned)Offset && "consistency!");
     AllocatedStackSlots.set(Offset);
   }
+
   bool isStackSlotAllocated(int Offset) {
     assert(Offset >= 0 && Offset < (int)AllocatedStackSlots.size() &&
            "out of bounds");




More information about the llvm-commits mailing list