Tim Armstrong has posted comments on this change. Change subject: IMPALA-4929: Safe concurrent access to IR function call graph ......................................................................
Patch Set 1: (12 comments) Thanks for the cleanup - I think this makes it easier to understand the callgraph http://gerrit.cloudera.org:8080/#/c/6326/1/be/src/codegen/codegen-callgraph.cc File be/src/codegen/codegen-callgraph.cc: Line 27: using namespace strings; You can use common/names.h instead of the string and unordered_* usings. Line 35: Status status = Can combine this with the below line. PS1, Line 71: boost:: I believe this creates two unordered_sets (the Lvalue and Rvalue), then copies the rvalue to the lvalue then destroys the rvalue. I think if you use emplace(fn_name) that just initialises the set inside the map: http://en.cppreference.com/w/cpp/container/unordered_map/emplace The boost:: package name is also not needed. Line 87: call_graph_[key].insert(fn_name); I think we can use find(key)->insert here, since we don't really want the behaviour of auto-creating entries. http://gerrit.cloudera.org:8080/#/c/6326/1/be/src/codegen/codegen-callgraph.h File be/src/codegen/codegen-callgraph.h: Line 29: class CodegenCallGraph { One line class comment? PS1, Line 39: inline I believe "inline" is implied for all methods defined in the class body: https://isocpp.org/wiki/faq/inline-functions#inline-member-fns-more Line 43: if (LIKELY(iter != call_graph_.end())) { Consider using ? : to make this a one-liner PS1, Line 46: NULL nullptr? PS1, Line 51: inline unnecessary inline Line 71: /// and return them in 'users'. "append them to 'users'", to make it clear that it doesn't clear existing contents. http://gerrit.cloudera.org:8080/#/c/6326/1/be/src/codegen/llvm-codegen.cc File be/src/codegen/llvm-codegen.cc: PS1, Line 290: NULL nit: we've mostly standardised on nullptr PS1, Line 594: (*callees) nit: unnecessary parens -- To view, visit http://gerrit.cloudera.org:8080/6326 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1acd6bad80341121c8189d817e0fe62f2862f28a Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Michael Ho <k...@cloudera.com> Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com> Gerrit-HasComments: Yes