[PATCH] D22980: Imported statistics types changes
Piotr Padlewski via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 1 15:29:02 PDT 2016
Prazek marked 2 inline comments as done.
================
Comment at: lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp:52-59
@@ -51,5 +51,10 @@
CallerNode.InlinedCallees.push_back(&CalleeNode);
- if (!CallerNode.Imported)
- // Save Caller as a starting node for traversal.
- NonImportedCallers.push_back(Caller.getName());
+ if (!CallerNode.Imported) {
+ // We could avoid second lookup, but it would make the code ultra ugly.
+ auto It = NodesMap.find(Caller.getName());
+ assert(It != NodesMap.end() && "The node should be already there.");
+ // Save Caller as a starting node for traversal. The string has to be one
+ // from map because Caller can disappear (and function name with it).
+ NonImportedCallers.push_back(It->first());
+ }
}
----------------
exactly.
https://reviews.llvm.org/D22980
More information about the llvm-commits
mailing list