simplify: we have solid argument iterator range
authorGabor Greif <ggreif@gmail.com>
Mon, 28 Jun 2010 16:40:52 +0000 (16:40 +0000)
committerGabor Greif <ggreif@gmail.com>
Mon, 28 Jun 2010 16:40:52 +0000 (16:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107014 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/DwarfEHPrepare.cpp

index 007289ce7711dc54df57a7a3722962c1c860864d..3fb4019cccdd1ba68b6bfb24a2d3a0dcd1c9118c 100644 (file)
@@ -383,24 +383,21 @@ bool DwarfEHPrepare::HandleURoRInvokes() {
            SI = SelsToConvert.begin(), SE = SelsToConvert.end();
          SI != SE; ++SI) {
       IntrinsicInst *II = *SI;
-      SmallVector<Value*, 8> Args;
 
       // Use the exception object pointer and the personality function
       // from the original selector.
       CallSite CS(II);
       IntrinsicInst::op_iterator I = CS.arg_begin();
-      Args.push_back(*I++); // Exception object pointer.
-      Args.push_back(*I++); // Personality function.
-
       IntrinsicInst::op_iterator E = CS.arg_end();
       IntrinsicInst::op_iterator B = prior(E);
 
       // Exclude last argument if it is an integer.
       if (isa<ConstantInt>(B)) E = B;
 
-      // Add in any filter IDs.
-      for (; I != E; ++I)
-        Args.push_back(*I);
+      // Add exception object pointer (front).
+      // Add personality function (next).
+      // Add in any filter IDs (rest).
+      SmallVector<Value*, 8> Args(I, E);
 
       Args.push_back(EHCatchAllValue->getInitializer()); // Catch-all indicator.