Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / lib / memprof / memprof_descriptions.h
blobe88ea441bf9ea64eea8d981c388fd0140560fa27
1 //===-- memprof_descriptions.h ---------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of MemProfiler, a memory profiler.
11 // MemProf-private header for memprof_descriptions.cpp.
12 //===----------------------------------------------------------------------===//
13 #ifndef MEMPROF_DESCRIPTIONS_H
14 #define MEMPROF_DESCRIPTIONS_H
16 #include "memprof_allocator.h"
17 #include "memprof_thread.h"
18 #include "sanitizer_common/sanitizer_common.h"
19 #include "sanitizer_common/sanitizer_report_decorator.h"
21 namespace __memprof {
23 void DescribeThread(MemprofThreadContext *context);
24 inline void DescribeThread(MemprofThread *t) {
25 if (t)
26 DescribeThread(t->context());
29 class MemprofThreadIdAndName {
30 public:
31 explicit MemprofThreadIdAndName(MemprofThreadContext *t);
32 explicit MemprofThreadIdAndName(u32 tid);
34 // Contains "T%tid (%name)" or "T%tid" if the name is empty.
35 const char *c_str() const { return &name[0]; }
37 private:
38 void Init(u32 tid, const char *tname);
40 char name[128];
43 } // namespace __memprof
45 #endif // MEMPROF_DESCRIPTIONS_H