[PATCH] D50670: Implementation of nested loops in cxx_loop_proto
Matt Morehouse via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 15 15:15:20 PDT 2018
morehouse added inline comments.
================
Comment at: clang/tools/clang-fuzzer/proto-to-cxx/loop_proto_to_cxx.cpp:124
+void SingleLoopToString(std::ostream &os, const LoopFunction &x) {
+ inner_loop = false;
+ os << "void foo(int *a, int *b, int *__restrict__ c, size_t s) {\n"
----------------
Why do we need to set `inner_loop` from different functions?
Again, using the global like this is just too easy to screw up. I'd like to see it default to false and then have a scoped wrapper that sets it to true only for the duration necessary.
================
Comment at: clang/tools/clang-fuzzer/proto-to-llvm/loop_proto_to_llvm.cpp:137
+ << x.outer_statements();
+ inner_loop = true;
+ os << "%o_ct_new = add i64 %outer_ct, 1\n"
----------------
Same comment as above. I'm getting confused trying to understand what `inner_loop` is set to at any given point.
Repository:
rC Clang
https://reviews.llvm.org/D50670
More information about the cfe-commits
mailing list