aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/lldb/include/lldb/Utility/Timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/lldb/include/lldb/Utility/Timer.h')
-rw-r--r--contrib/llvm-project/lldb/include/lldb/Utility/Timer.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/llvm-project/lldb/include/lldb/Utility/Timer.h b/contrib/llvm-project/lldb/include/lldb/Utility/Timer.h
index f97315b2db0f..edc064b23b57 100644
--- a/contrib/llvm-project/lldb/include/lldb/Utility/Timer.h
+++ b/contrib/llvm-project/lldb/include/lldb/Utility/Timer.h
@@ -25,6 +25,7 @@ public:
class Category {
public:
explicit Category(const char *category_name);
+ llvm::StringRef GetName() { return m_name; }
private:
friend class Timer;
@@ -73,4 +74,11 @@ private:
} // namespace lldb_private
+#define LLDB_SCOPED_TIMER() \
+ static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \
+ ::lldb_private::Timer _scoped_timer(_cat, LLVM_PRETTY_FUNCTION)
+#define LLDB_SCOPED_TIMERF(...) \
+ static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \
+ ::lldb_private::Timer _scoped_timer(_cat, __VA_ARGS__)
+
#endif // LLDB_UTILITY_TIMER_H