[PATCH] D83351: [llvm-reduce] Reducing attributes

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 10:15:39 PDT 2020


nickdesaulniers added inline comments.


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:68-70
+    if (!AS.getNumAttributes())
+      return; // No attributes to begin with.
+    visitAttributeSet(AS, GlobalVariablesToRefine[&GV]);
----------------
```
if (AS.getNumAttributes())
  visitAttributeSet(AS, GlobalVariablesToRefine[&GV]);
```


================
Comment at: llvm/tools/llvm-reduce/deltas/ReduceAttributes.cpp:60-61
+  void visitModule(Module &M) {
+    for_each(M.getGlobalList(),
+             [&](GlobalVariable &GV) { visitGlobalVariable(GV); });
+  }
----------------
lebedev.ri wrote:
> dblaikie wrote:
> > range-based-for loop, probably?
> Hm, can use either. Why not `for_each` ?
I find the range-for more concise, FWIW.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83351/new/

https://reviews.llvm.org/D83351





More information about the llvm-commits mailing list