15 #ifndef GTIRB_SYMBOLICEXPRESSION_H
16 #define GTIRB_SYMBOLICEXPRESSION_H
19 #include <gtirb/proto/SymbolicExpression.pb.h>
21 #include <boost/range/iterator_range.hpp>
49 GOT = proto::SymAttribute::GOT,
50 GOTPC = proto::SymAttribute::GOTPC,
51 GOTOFF = proto::SymAttribute::GOTOFF,
52 GOTREL = proto::SymAttribute::GOTREL,
53 PLT = proto::SymAttribute::PLT,
54 PLTOFF = proto::SymAttribute::PLTOFF,
55 PCREL = proto::SymAttribute::PCREL,
56 SECREL = proto::SymAttribute::SECREL,
57 TLS = proto::SymAttribute::TLS,
58 TLSGD = proto::SymAttribute::TLSGD,
59 TLSLD = proto::SymAttribute::TLSLD,
60 TLSLDM = proto::SymAttribute::TLSLDM,
61 TLSCALL = proto::SymAttribute::TLSCALL,
62 TLSDESC = proto::SymAttribute::TLSDESC,
63 TPREL = proto::SymAttribute::TPREL,
64 TPOFF = proto::SymAttribute::TPOFF,
65 DTPREL = proto::SymAttribute::DTPREL,
66 DTPOFF = proto::SymAttribute::DTPOFF,
67 DTPMOD = proto::SymAttribute::DTPMOD,
68 NTPOFF = proto::SymAttribute::NTPOFF,
69 PAGE = proto::SymAttribute::PAGE,
70 PAGEOFF = proto::SymAttribute::PAGEOFF,
71 CALL = proto::SymAttribute::CALL,
72 LO = proto::SymAttribute::LO,
73 HI = proto::SymAttribute::HI,
74 HIGHER = proto::SymAttribute::HIGHER,
75 HIGHEST = proto::SymAttribute::HIGHEST,
78 GOTNTPOFF = proto::SymAttribute::GOTNTPOFF,
79 INDNTPOFF = proto::SymAttribute::INDNTPOFF,
82 G0 = proto::SymAttribute::G0,
83 G1 = proto::SymAttribute::G1,
84 G2 = proto::SymAttribute::G2,
85 G3 = proto::SymAttribute::G3,
86 UPPER16 = proto::SymAttribute::UPPER16,
87 LOWER16 = proto::SymAttribute::LOWER16,
88 LO12 = proto::SymAttribute::LO12,
89 LO15 = proto::SymAttribute::LO15,
90 LO14 = proto::SymAttribute::LO14,
91 HI12 = proto::SymAttribute::HI12,
92 HI21 = proto::SymAttribute::HI21,
93 S = proto::SymAttribute::S,
94 PG = proto::SymAttribute::PG,
95 NC = proto::SymAttribute::NC,
96 ABS = proto::SymAttribute::ABS,
97 PREL = proto::SymAttribute::PREL,
98 PREL31 = proto::SymAttribute::PREL31,
99 TARGET1 = proto::SymAttribute::TARGET1,
100 TARGET2 = proto::SymAttribute::TARGET2,
101 SBREL = proto::SymAttribute::SBREL,
102 TLSLDO = proto::SymAttribute::TLSLDO,
105 HI16 = proto::SymAttribute::HI16,
106 LO16 = proto::SymAttribute::LO16,
107 GPREL = proto::SymAttribute::GPREL,
108 DISP = proto::SymAttribute::DISP,
109 OFST = proto::SymAttribute::OFST,
112 H = proto::SymAttribute::H,
113 L = proto::SymAttribute::L,
114 HA = proto::SymAttribute::HA,
115 HIGH = proto::SymAttribute::HIGH,
116 HIGHA = proto::SymAttribute::HIGHA,
117 HIGHERA = proto::SymAttribute::HIGHERA,
118 HIGHESTA = proto::SymAttribute::HIGHESTA,
119 TOCBASE = proto::SymAttribute::TOCBASE,
120 TOC = proto::SymAttribute::TOC,
121 NOTOC = proto::SymAttribute::NOTOC,
174 template <>
struct hash<
gtirb::SymAddrConst> {
179 const result_type Off = std::hash<int64_t>{}(Obj.Offset);
180 const result_type P = std::hash<gtirb::Symbol*>{}(Obj.Sym);
181 return Off ^ (P << 1);
185 template <>
struct hash<
gtirb::SymAddrAddr> {
191 comb(S, std::hash<int64_t>{}(Obj.Offset));
192 comb(S, std::hash<gtirb::Symbol*>{}(Obj.Sym1));
193 comb(S, std::hash<gtirb::Symbol*>{}(Obj.Sym2));
198 void comb(result_type& One, result_type Two)
const noexcept {
199 One ^= Two + 0x9e3779b9 + (One << 6) + (One >> 2);
204 #endif // GTIRB_SYMBOLICEXPRESSION_H