[PATCH] D48370: [XRay][llvm] Load XRay Profiles

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 03:14:38 PDT 2018


dberris planned changes to this revision.
dberris added inline comments.


================
Comment at: llvm/include/llvm/XRay/Profile.h:55-56
+
+  /// Provides a sequence of function IDs from a previously interned PathID.
+  Expected<std::vector<FuncID>> path(PathID P) const;
+
----------------
kpw wrote:
> Maybe call this expand and elaborate on what type of error conditions are possible. Is the Expected just for an invalid id?
Yes, error is for an unknown PathID -- called it `expandPath` instead.


================
Comment at: llvm/include/llvm/XRay/Profile.h:59
+  /// The stack represented in |P| must be in stack order (leaf to root).
+  PathID internPath(ArrayRef<FuncID> P);
+
----------------
kpw wrote:
> What happens when a caller provides an argument that has already been interned? Will they receive a new ID or the existing one?
Interning implies that it will return the same ID for the same path. This is very similar to string interning. I've made that a bit more explicit in the comment.


https://reviews.llvm.org/D48370





More information about the llvm-commits mailing list