ART: Fix reference-related warnings

Make some parameters and locals references to avoid unnecessary
copies.

Bug: 32619234
Test: m test-art-host
Change-Id: Idfed600c7c5492a80f72f51424253bcbea824a94
diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc
index dbb9dfc..db70e78 100644
--- a/dex2oat/dex2oat_test.cc
+++ b/dex2oat/dex2oat_test.cc
@@ -89,13 +89,31 @@
     return status;
   }
 
-  void GenerateOdexForTest(const std::string& dex_location,
-                           const std::string& odex_location,
-                           CompilerFilter::Filter filter,
-                           const std::vector<std::string>& extra_args = {},
-                           bool expect_success = true,
-                           bool use_fd = false,
-                           std::function<void(const OatFile&)> check_oat = [](const OatFile&) {}) {
+  void GenerateOdexForTest(
+      const std::string& dex_location,
+      const std::string& odex_location,
+      CompilerFilter::Filter filter,
+      const std::vector<std::string>& extra_args = {},
+      bool expect_success = true,
+      bool use_fd = false) {
+    GenerateOdexForTest(dex_location,
+                        odex_location,
+                        filter,
+                        extra_args,
+                        expect_success,
+                        use_fd,
+                        [](const OatFile&) {});
+  }
+
+  template <typename T>
+  void GenerateOdexForTest(
+      const std::string& dex_location,
+      const std::string& odex_location,
+      CompilerFilter::Filter filter,
+      const std::vector<std::string>& extra_args,
+      bool expect_success,
+      bool use_fd,
+      T check_oat) {
     std::string error_msg;
     int status = GenerateOdexForTestWithStatus({dex_location},
                                                odex_location,