[PATCH] D24377: [XRay] Implement the `llvm-xray account` subcommand

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 17:49:24 PST 2016


dberris added a comment.

In https://reviews.llvm.org/D24377#610170, @varno wrote:

> At line 182-195 the following code I think is simpler and results in the function performing the same work.
>
>   if (Parent == ThreadStack.rend())
>     return false;
>   while (ThreadStack.back().FuncId != Record.FuncId) {
>     const auto &Top = ThreadStack.back();
>     recordLatency(Top.first, diff(Top.second, Record.TSC)):
>     ThreadStack.pop_back();
>   }
>


Thanks -- after the refactoring suggested by @dblaikie though this became less of an issue.



================
Comment at: tools/llvm-xray/xray-account.cc:316
+      break;
+    default:;
+      // FIXME: Not supported yet.
----------------
dblaikie wrote:
> extra semicolon?
Apparently not, since if I leave this empty I get a warning that the default case is empty.

`label at end of compound statement: expected statement`


================
Comment at: tools/llvm-xray/xray-account.cc:395
+              return Error::success();
+            return Error(std::move(E));
+          }))
----------------
dblaikie wrote:
> No need for "Error(...)" here, this will do, I think:
> 
>   return std::move(E);
Apparently no. :(

```
error: no viable conversion from returned value of type 'typename std::remove_reference<unique_ptr<StringError, default_delete<StringError> > &>::type' (aka 'std::unique_ptr<llvm::StringEr
ror, std::default_delete<llvm::StringError> >') to function return type 'llvm::Error'
```


https://reviews.llvm.org/D24377





More information about the llvm-commits mailing list