ART: Move CopyOption to OatWriter

All the code has moved. Move the enum to where it's used.

Test: mmma art
Change-Id: Ia5d412acd1240365e74059681dbe8f62502382aa
diff --git a/compiler/compiler.h b/compiler/compiler.h
index f2ec3a9..ef3d87f 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -39,12 +39,6 @@
 class OatWriter;
 class Thread;
 
-enum class CopyOption {
-  kNever,
-  kAlways,
-  kOnlyIfCompressed
-};
-
 class Compiler {
  public:
   enum Kind {
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 779128f..3d4e112 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -2898,7 +2898,7 @@
 
   // By default, copy the dex to the vdex file only if dex files are
   // compressed in APK.
-  CopyOption copy_dex_files_ = CopyOption::kOnlyIfCompressed;
+  linker::CopyOption copy_dex_files_ = linker::CopyOption::kOnlyIfCompressed;
 
   // The reason for invoking the compiler.
   std::string compilation_reason_;
diff --git a/dex2oat/dex2oat_options.cc b/dex2oat/dex2oat_options.cc
index dbb00c2..bf9edf7 100644
--- a/dex2oat/dex2oat_options.cc
+++ b/dex2oat/dex2oat_options.cc
@@ -222,10 +222,10 @@
       .Define("--force-determinism")
           .IntoKey(M::ForceDeterminism)
       .Define("--copy-dex-files=_")
-          .WithType<CopyOption>()
-          .WithValueMap({{"true", CopyOption::kOnlyIfCompressed},
-                         {"false", CopyOption::kNever},
-                         {"always", CopyOption::kAlways}})
+          .WithType<linker::CopyOption>()
+          .WithValueMap({{"true", linker::CopyOption::kOnlyIfCompressed},
+                         {"false", linker::CopyOption::kNever},
+                         {"always", linker::CopyOption::kAlways}})
           .IntoKey(M::CopyDexFiles)
       .Define("--classpath-dir=_")
           .WithType<std::string>()
diff --git a/dex2oat/dex2oat_options.def b/dex2oat/dex2oat_options.def
index 7be8e56..fe5c4e6 100644
--- a/dex2oat/dex2oat_options.def
+++ b/dex2oat/dex2oat_options.def
@@ -70,7 +70,7 @@
 DEX2OAT_OPTIONS_KEY (Unit,                           DumpTiming)
 DEX2OAT_OPTIONS_KEY (Unit,                           DumpPasses)
 DEX2OAT_OPTIONS_KEY (Unit,                           DumpStats)
-DEX2OAT_OPTIONS_KEY (CopyOption,                     CopyDexFiles)
+DEX2OAT_OPTIONS_KEY (linker::CopyOption,             CopyDexFiles)
 DEX2OAT_OPTIONS_KEY (Unit,                           AvoidStoringInvocation)
 DEX2OAT_OPTIONS_KEY (std::string,                    SwapFile)
 DEX2OAT_OPTIONS_KEY (int,                            SwapFileFd)
diff --git a/dex2oat/dex2oat_options.h b/dex2oat/dex2oat_options.h
index cc124c1..27d3d25 100644
--- a/dex2oat/dex2oat_options.h
+++ b/dex2oat/dex2oat_options.h
@@ -28,6 +28,7 @@
 #include "dex/compact_dex_level.h"
 #include "driver/compiler_options_map.h"
 #include "image.h"
+#include "linker/oat_writer.h"
 
 namespace art {
 
diff --git a/dex2oat/linker/oat_writer.h b/dex2oat/linker/oat_writer.h
index ccafe05..e8eee88 100644
--- a/dex2oat/linker/oat_writer.h
+++ b/dex2oat/linker/oat_writer.h
@@ -27,7 +27,6 @@
 #include "base/os.h"
 #include "base/mem_map.h"
 #include "base/safe_map.h"
-#include "compiler.h"
 #include "debug/debug_info.h"
 #include "dex/compact_dex_level.h"
 #include "dex/method_reference.h"
@@ -64,6 +63,12 @@
 class MultiOatRelativePatcher;
 class OutputStream;
 
+enum class CopyOption {
+  kNever,
+  kAlways,
+  kOnlyIfCompressed
+};
+
 // OatHeader         variable length with count of D OatDexFiles
 //
 // TypeLookupTable[0] one descriptor to class def index hash table for each OatDexFile.