8 #ifndef LLDB_UTILITY_INSTRUMENTATION_H
9 #define LLDB_UTILITY_INSTRUMENTATION_H
13 #include "llvm/ADT/DenseMap.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/ErrorHandling.h"
19 #include <type_traits>
22 namespace instrumentation {
25 typename std::enable_if<std::is_fundamental<T>::value,
int>::type = 0>
30 template <typename T, typename std::enable_if<!std::is_fundamental<T>::value,
38 ss << reinterpret_cast<void *>(t);
43 ss << reinterpret_cast<const void *>(t);
49 ss <<
'\"' << t <<
'\"';
53 inline void stringify_append<std::nullptr_t>(llvm::raw_string_ostream &ss,
54 const std::nullptr_t &t) {
58 template <
typename Head>
63 template <
typename Head,
typename... Tail>
65 const Tail &...tail) {
73 llvm::raw_string_ostream ss(buffer);
95 #define LLDB_INSTRUMENT() \
96 lldb_private::instrumentation::Instrumenter _instr(LLVM_PRETTY_FUNCTION);
98 #define LLDB_INSTRUMENT_VA(...) \
99 lldb_private::instrumentation::Instrumenter _instr( \
100 LLVM_PRETTY_FUNCTION, \
101 lldb_private::instrumentation::stringify_args(__VA_ARGS__));
103 #endif // LLDB_UTILITY_INSTRUMENTATION_H