[llvm] r259133 - [RS4GC] Minor cleanups enabled by the previous change; NFC

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 28 17:03:21 PST 2016


Author: sanjoy
Date: Thu Jan 28 19:03:20 2016
New Revision: 259133

URL: http://llvm.org/viewvc/llvm-project?rev=259133&view=rev
Log:
[RS4GC] Minor cleanups enabled by the previous change; 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=259133&r1=259132&r2=259133&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Thu Jan 28 19:03:20 2016
@@ -1390,21 +1390,17 @@ makeStatepointExplicitImpl(const CallSit
   uint32_t NumPatchBytes = 0;
   uint32_t Flags = uint32_t(StatepointFlags::None);
 
-  ArrayRef<Use> CallArgs;
-  ArrayRef<Use> DeoptArgs;
+  ArrayRef<Use> CallArgs(CS.arg_begin(), CS.arg_end());
+  ArrayRef<Use> DeoptArgs = GetDeoptBundleOperands(CS);
   ArrayRef<Use> TransitionArgs;
-
-  Value *CallTarget = nullptr;
-
-  CallArgs = {CS.arg_begin(), CS.arg_end()};
-  DeoptArgs = GetDeoptBundleOperands(CS);
   if (auto TransitionBundle =
       CS.getOperandBundle(LLVMContext::OB_gc_transition)) {
     Flags |= uint32_t(StatepointFlags::GCTransition);
     TransitionArgs = TransitionBundle->Inputs;
   }
-  AttributeSet OriginalAttrs = CS.getAttributes();
 
+  Value *CallTarget = CS.getCalledValue();
+  AttributeSet OriginalAttrs = CS.getAttributes();
   Attribute AttrID = OriginalAttrs.getAttribute(AttributeSet::FunctionIndex,
                                                 "statepoint-id");
   if (AttrID.isStringAttribute())
@@ -1415,9 +1411,6 @@ makeStatepointExplicitImpl(const CallSit
   if (AttrNumPatchBytes.isStringAttribute())
     AttrNumPatchBytes.getValueAsString().getAsInteger(10, NumPatchBytes);
 
-  CallTarget = CS.getCalledValue();
-
-
   // Create the statepoint given all the arguments
   Instruction *Token = nullptr;
   AttributeSet ReturnAttrs;
@@ -2224,9 +2217,8 @@ static bool insertParsePoints(Function &
   Uniqued.insert(ToUpdate.begin(), ToUpdate.end());
   assert(Uniqued.size() == ToUpdate.size() && "no duplicates please!");
 
-  for (CallSite CS : ToUpdate) {
-    assert(CS.getInstruction()->getParent()->getParent() == &F);
-  }
+  for (CallSite CS : ToUpdate)
+    assert(CS.getInstruction()->getFunction() == &F);
 #endif
 
   // When inserting gc.relocates for invokes, we need to be able to insert at




More information about the llvm-commits mailing list