-
Notifications
You must be signed in to change notification settings - Fork 113
/
llvm_propeller_formatting.h
46 lines (31 loc) · 1.19 KB
/
llvm_propeller_formatting.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
#ifndef AUTOFDO_LLVM_PROPELLER_FORMATTING_H_
#define AUTOFDO_LLVM_PROPELLER_FORMATTING_H_
#include <cstdint> // for uint64_t
#include <ostream>
namespace devtools_crosstool_autofdo {
class CFGEdge;
struct SymbolEntry;
struct CommaStyleNumberFormatter {
explicit CommaStyleNumberFormatter(uint64_t v) : value(v) {}
uint64_t value;
};
struct SymbolNameFormatter {
explicit SymbolNameFormatter(const SymbolEntry &s) : sym(&s) {}
explicit SymbolNameFormatter(const SymbolEntry *s) : sym(s) {}
const SymbolEntry *sym;
};
struct CFGEdgeNameFormatter {
explicit CFGEdgeNameFormatter(const CFGEdge *e) : edge(e) {}
explicit CFGEdgeNameFormatter(const CFGEdge &e) : edge(&e){}
const CFGEdge *edge;
};
struct AddressFormatter {
explicit AddressFormatter(uint64_t a): addr(a) {}
uint64_t addr;
};
std::ostream &operator<<(std::ostream &out, const CommaStyleNumberFormatter &f);
std::ostream &operator<<(std::ostream &out, const SymbolNameFormatter &f);
std::ostream &operator<<(std::ostream &out, const CFGEdgeNameFormatter &f);
std::ostream &operator<<(std::ostream &out, const AddressFormatter &f);
} // namespace devtools_crosstool_autofdo
#endif // AUTOFDO_LLVM_PROPELLER_FORMATTING_H_