Make ImageWriter and PatchOat helper classes nested.
Nested classes are better for encapsulation. For example,
we've had an art::FixupRootVisitor in both image_writer.cc
and patchoat.cc and we didn't get an ODR violation only
because these two files are never used in the same process.
Test: Rely on the TreeHugger.
Change-Id: I39a86994923a9c0faa5f05d8c9ede982ce9c0c4c
diff --git a/compiler/image_writer.h b/compiler/image_writer.h
index c9cf4cb..24fad46 100644
--- a/compiler/image_writer.h
+++ b/compiler/image_writer.h
@@ -582,14 +582,15 @@
// Map of dex files to the indexes of oat files that they were compiled into.
const std::unordered_map<const DexFile*, size_t>& dex_file_oat_index_map_;
- friend class ContainsBootClassLoaderNonImageClassVisitor;
- friend class FixupClassVisitor;
- friend class FixupRootVisitor;
- friend class FixupVisitor;
+ class ComputeLazyFieldsForClassesVisitor;
+ class FixupClassVisitor;
+ class FixupRootVisitor;
+ class FixupVisitor;
class GetRootsVisitor;
- friend class NativeLocationVisitor;
- friend class NonImageClassesVisitor;
+ class NativeLocationVisitor;
+ class NonImageClassesVisitor;
class VisitReferencesVisitor;
+
DISALLOW_COPY_AND_ASSIGN(ImageWriter);
};