[PATCH] D105927: [analyzer] Extend operator overloading for ' - ' and ' + ' operators on llvm::TimeRecord

Artem Dergachev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 13 12:37:41 PDT 2021


NoQ added a comment.

Nice! Please add some reviewers based on git blame for `Timer.h`.



================
Comment at: llvm/include/llvm/Support/Timer.h:69
   }
+  TimeRecord operator-(const TimeRecord &RHS) {
+    TimeRecord TR(*this);
----------------
Did you try the suggested canonical form from https://en.cppreference.com/w/cpp/language/operators? It's a bit shorter and they say it's more optimizer-friendly.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105927/new/

https://reviews.llvm.org/D105927



More information about the llvm-commits mailing list