[llvm] r222491 - Add curly braces to workaround an MSVC bug.

Sean Silva chisophugis at gmail.com
Thu Nov 20 18:04:07 PST 2014


-  for (auto &I: BB)
+  for (auto &I : BB)
+  {
     Assert(I.getParent() == &BB, "Instruction has bogus parent pointer!");
+  }


Please match the surrounding brace style.

-- Sean Silva


On Thu, Nov 20, 2014 at 5:19 PM, Zachary Turner <zturner at google.com> wrote:

> Author: zturner
> Date: Thu Nov 20 19:19:09 2014
> New Revision: 222491
>
> URL: http://llvm.org/viewvc/llvm-project?rev=222491&view=rev
> Log:
> Add curly braces to workaround an MSVC bug.
>
> MSVC can't parse this pattern for range-based for loops.
>
> Modified:
>     llvm/trunk/lib/IR/Verifier.cpp
>
> Modified: llvm/trunk/lib/IR/Verifier.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=222491&r1=222490&r2=222491&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/IR/Verifier.cpp (original)
> +++ llvm/trunk/lib/IR/Verifier.cpp Thu Nov 20 19:19:09 2014
> @@ -1178,8 +1178,10 @@ void Verifier::visitBasicBlock(BasicBloc
>    }
>
>    // Check that all instructions have their parent pointers set up
> correctly.
> -  for (auto &I: BB)
> +  for (auto &I : BB)
> +  {
>      Assert(I.getParent() == &BB, "Instruction has bogus parent pointer!");
> +  }
>  }
>
>  void Verifier::visitTerminatorInst(TerminatorInst &I) {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141120/df0a9824/attachment.html>


More information about the llvm-commits mailing list