ART: Give veridex ART defaults
To enable tidy checks and other ART standards. Remove unnecessary
defaulted copy constructor to avoid deprecation error for the
copy assignment. Fix tidy errors.
Bug: 32619234
Test: mmma art/tools/veridex
Change-Id: I8bb6b55dc86476402d2e955029e20c494c30ba45
diff --git a/tools/veridex/Android.bp b/tools/veridex/Android.bp
index 96d4a09..92ace03 100644
--- a/tools/veridex/Android.bp
+++ b/tools/veridex/Android.bp
@@ -14,6 +14,7 @@
cc_binary {
name: "veridex",
+ defaults: ["art_defaults"],
host_supported: true,
srcs: [
"flow_analysis.cc",
diff --git a/tools/veridex/hidden_api_finder.cc b/tools/veridex/hidden_api_finder.cc
index cb45c58..a8c53b3 100644
--- a/tools/veridex/hidden_api_finder.cc
+++ b/tools/veridex/hidden_api_finder.cc
@@ -232,7 +232,7 @@
counts[ref_string]++;
}
- for (const std::pair<const std::string, const size_t>& pair : counts) {
+ for (const std::pair<const std::string, size_t>& pair : counts) {
os << kPrefix << pair.first;
if (pair.second > 1) {
os << " (" << pair.second << " occurrences)";
diff --git a/tools/veridex/precise_hidden_api_finder.cc b/tools/veridex/precise_hidden_api_finder.cc
index 08ac6d7..9e02cbf 100644
--- a/tools/veridex/precise_hidden_api_finder.cc
+++ b/tools/veridex/precise_hidden_api_finder.cc
@@ -85,7 +85,7 @@
void PreciseHiddenApiFinder::Dump(std::ostream& os, HiddenApiStats* stats) {
static const char* kPrefix = " ";
std::map<std::string, std::vector<MethodReference>> named_uses;
- for (auto it : concrete_uses_) {
+ for (auto& it : concrete_uses_) {
MethodReference ref = it.first;
for (const ReflectAccessInfo& info : it.second) {
std::string cls(info.cls.ToString());
@@ -98,7 +98,7 @@
}
}
- for (auto it : named_uses) {
+ for (auto& it : named_uses) {
++stats->reflection_count;
const std::string& full_name = it.first;
HiddenApiAccessFlags::ApiList api_list = hidden_api_.GetApiList(full_name);
diff --git a/tools/veridex/veridex.h b/tools/veridex/veridex.h
index 31ddbf4..e0d8261 100644
--- a/tools/veridex/veridex.h
+++ b/tools/veridex/veridex.h
@@ -44,7 +44,6 @@
*/
class VeriClass {
public:
- VeriClass(const VeriClass& other) = default;
VeriClass() = default;
VeriClass(Primitive::Type k, uint8_t dims, const DexFile::ClassDef* cl)
: kind_(k), dimensions_(dims), class_def_(cl) {}