Remove kBytesFieldAtoms from atoms_info

Bug: 150415347
Test: m
Test: bit statsd_test:*
Change-Id: I2e55b445121a39e3bf12164cd9123561e8b5bd4c
This commit is contained in:
Muhammad Qureshi
2020-03-20 10:55:46 -07:00
parent 707263d99c
commit f77913fbc6
4 changed files with 2 additions and 64 deletions

View File

@@ -55,8 +55,7 @@ AtomDecl::AtomDecl(const AtomDecl &that)
resetState(that.resetState),
nested(that.nested),
uidField(that.uidField),
whitelisted(that.whitelisted),
binaryFields(that.binaryFields) {}
whitelisted(that.whitelisted) {}
AtomDecl::AtomDecl(int c, const string& n, const string& m)
:code(c),
@@ -422,10 +421,6 @@ int collate_atom(const Descriptor *atom, AtomDecl *atomDecl,
continue;
}
}
// Binary field validity is already checked above.
if (isBinaryField) {
atomDecl->binaryFields.push_back(it->first);
}
}
return errorCount;

View File

@@ -147,8 +147,6 @@ struct AtomDecl {
bool whitelisted = false;
vector<int> binaryFields;
AtomDecl();
AtomDecl(const AtomDecl& that);
AtomDecl(int code, const string& name, const string& message);

View File

@@ -47,9 +47,6 @@ static void write_atoms_info_header_body(FILE* out, const Atoms& atoms) {
fprintf(out,
" const static std::map<int, StateAtomFieldOptions> "
"kStateAtomsFieldOptions;\n");
fprintf(out,
" const static std::map<int, std::vector<int>> "
"kBytesFieldAtoms;\n");
fprintf(out,
" const static std::set<int> kWhitelistedAtoms;\n");
fprintf(out, "};\n");
@@ -175,35 +172,6 @@ static void write_atoms_info_cpp_body(FILE* out, const Atoms& atoms) {
"const std::map<int, StateAtomFieldOptions> "
"AtomsInfo::kStateAtomsFieldOptions = "
"getStateAtomFieldOptions();\n");
fprintf(out,
"static std::map<int, std::vector<int>> "
"getBinaryFieldAtoms() {\n");
fprintf(out, " std::map<int, std::vector<int>> options;\n");
for (set<AtomDecl>::const_iterator atom = atoms.decls.begin();
atom != atoms.decls.end(); atom++) {
if (atom->binaryFields.size() == 0) {
continue;
}
fprintf(out,
"\n // Adding binary fields for atom "
"(%d)%s\n",
atom->code, atom->name.c_str());
for (const auto& field : atom->binaryFields) {
fprintf(out, " options[%d /* %s */].push_back(%d);\n",
atom->code, make_constant_name(atom->name).c_str(), field);
}
}
fprintf(out, " return options;\n");
fprintf(out, "}\n");
fprintf(out,
"const std::map<int, std::vector<int>> "
"AtomsInfo::kBytesFieldAtoms = "
"getBinaryFieldAtoms();\n");
}
int write_atoms_info_header(FILE* out, const Atoms &atoms, const string& namespaceStr) {