llvm/lldb/include/lldb/Utility/Instrumentation.h

//===-- Instrumentation.h ---------------------------------------*- C++ -*-===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_UTILITY_INSTRUMENTATION_H
#define LLDB_UTILITY_INSTRUMENTATION_H

#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ErrorHandling.h"

#include <map>
#include <thread>
#include <type_traits>

namespace lldb_private {
namespace instrumentation {

template <typename T, std::enable_if_t<std::is_fundamental<T>::value, int> = 0>
inline void stringify_append(llvm::raw_string_ostream &ss, const T &t) {}

template <typename T, std::enable_if_t<!std::is_fundamental<T>::value, int> = 0>
inline void stringify_append(llvm::raw_string_ostream &ss, const T &t) {}

template <typename T>
inline void stringify_append(llvm::raw_string_ostream &ss, T *t) {}

template <typename T>
inline void stringify_append(llvm::raw_string_ostream &ss, const T *t) {}

template <>
inline void stringify_append<char>(llvm::raw_string_ostream &ss,
                                   const char *t) {}

template <>
inline void stringify_append<std::nullptr_t>(llvm::raw_string_ostream &ss,
                                             const std::nullptr_t &t) {}

template <typename Head>
inline void stringify_helper(llvm::raw_string_ostream &ss, const Head &head) {}

template <typename Head, typename... Tail>
inline void stringify_helper(llvm::raw_string_ostream &ss, const Head &head,
                             const Tail &...tail) {}

template <typename... Ts> inline std::string stringify_args(const Ts &...ts) {}

/// RAII object for instrumenting LLDB API functions.
class Instrumenter {};
} // namespace instrumentation
} // namespace lldb_private

#define LLDB_INSTRUMENT()

#define LLDB_INSTRUMENT_VA(...)

#endif // LLDB_UTILITY_INSTRUMENTATION_H