-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathReporter.h
54 lines (41 loc) · 805 Bytes
/
Reporter.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
#ifndef _REPORTER_H
#define _REPORTER_H
#include <iostream>
#include <string>
#include "clang/Basic/SourceLocation.h"
namespace clang
{
class SourceManager;
class Stmt;
class Decl;
}
class ConnectCall;
class ReportStream
{
public:
~ReportStream();
template <class T>
ReportStream &operator<<(const T &x)
{
std::cerr << " " << x;
return *this;
}
};
class Reporter
{
public:
Reporter(clang::SourceManager &sourceManager);
~Reporter();
ReportStream report(const clang::Stmt *stmt);
ReportStream report(const clang::Decl *decl);
ReportStream report(const ConnectCall &);
ReportStream report(const clang::SourceRange &);
unsigned int totalReports() const
{
return mTotalReports;
}
private:
clang::SourceManager &mSourceManager;
unsigned int mTotalReports = 0;
};
#endif