void SetUseCounters(bool UC) { UseCounters = UC; }
void SetUseValueProfile(bool VP) { UseValueProfile = VP; }
void SetPrintNewPCs(bool P) { DoPrintNewPCs = P; }
- template <class Callback> size_t CollectFeatures(Callback CB);
+ template <class Callback> size_t CollectFeatures(Callback CB) const;
void ResetMaps() {
ValueProfileMap.Reset();
};
template <class Callback>
-size_t TracePC::CollectFeatures(Callback CB) {
+size_t TracePC::CollectFeatures(Callback CB) const {
if (!UsingTracePcGuard()) return 0;
size_t Res = 0;
const size_t Step = 8;
for (size_t i = Idx; i < Idx + Step; i++) {
uint8_t Counter = (Bundle >> ((i - Idx) * 8)) & 0xff;
if (!Counter) continue;
- Counters[i] = 0;
unsigned Bit = 0;
/**/ if (Counter >= 128) Bit = 7;
else if (Counter >= 32) Bit = 6;
template <class Callback>
ATTRIBUTE_NO_SANITIZE_ALL
- void ForEach(Callback CB) {
+ void ForEach(Callback CB) const {
for (size_t i = 0; i < kMapSizeInWords; i++)
if (uintptr_t M = Map[i])
for (size_t j = 0; j < sizeof(M) * 8; j++)