[PATCH] D42123: Derive GEP index type from Data Layout

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 18 17:05:32 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Analysis/ConstantFolding.cpp:812
+  // The transformation is legal if GEP index and pointer have the same width. 
+  if (IndexTy->getPrimitiveSizeInBits() == IntPtrTy->getPrimitiveSizeInBits())
+    for (unsigned i = 1, e = Ops.size(); i != e; ++i)
----------------
Can you put curly braces after this if and the for loop below it to help with readability? I know the for loop didn't have them before, but I feel like it should have. I tend to think that if the inner scope is curly braced, the outer scope should be too.


Repository:
  rL LLVM

https://reviews.llvm.org/D42123





More information about the llvm-commits mailing list