forked from mikael-s-persson/templight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TemplightTracer.h
65 lines (41 loc) · 1.58 KB
/
TemplightTracer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//===- TemplightTracer.h ------ Clang Templight Profiler / Tracer -*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TEMPLIGHT_TRACER_H
#define LLVM_CLANG_TEMPLIGHT_TRACER_H
#include "clang/Sema/TemplateInstCallbacks.h"
#include <memory>
#include <string>
namespace clang {
class TemplightTracer : public TemplateInstantiationCallbacks {
public:
class TracePrinter; // forward-decl.
protected:
void initializeImpl(const Sema &TheSema) override;
void finalizeImpl(const Sema &TheSema) override;
void atTemplateBeginImpl(const Sema &TheSema, const ActiveTemplateInstantiation& Inst) override;
void atTemplateEndImpl(const Sema &TheSema, const ActiveTemplateInstantiation& Inst) override;
private:
unsigned MemoryFlag : 1;
unsigned SafeModeFlag : 1;
std::unique_ptr<TracePrinter> Printer;
public:
/// \brief Sets the format type of the template trace file.
/// The argument can be xml/yaml/text
TemplightTracer(const Sema &TheSema,
std::string Output = "",
bool Memory = false,
bool Safemode = false,
bool IgnoreSystem = false);
~TemplightTracer() override;
bool getMemoryFlag() const { return MemoryFlag; };
bool getSafeModeFlag() const { return SafeModeFlag; };
void readBlacklists(const std::string& BLFilename);
};
}
#endif