Separate HostOrDevice out of Arch

Take HostOrDevice out of Arch, and put it into AndroidModuleBase
instead.  Also separate out the host vs. device mutator from
ArchMutator.  This will make it possible for genrules to depend
on a host tool, regardless of which host arches it is compiled
for.

Change-Id: I22bbfd28b65c3eebdfa101a712f90dd615148dc8
diff --git a/cc/cc.go b/cc/cc.go
index 5d72097..a928312 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -342,10 +342,11 @@
 
 func (c *CCBase) findToolchain(ctx common.AndroidModuleContext) Toolchain {
 	arch := ctx.Arch()
-	factory := toolchainFactories[arch.HostOrDevice][arch.ArchType]
+	hod := ctx.HostOrDevice()
+	factory := toolchainFactories[hod][arch.ArchType]
 	if factory == nil {
 		panic(fmt.Sprintf("Toolchain not found for %s arch %q",
-			arch.HostOrDevice.String(), arch.String()))
+			hod.String(), arch.String()))
 	}
 	return factory(arch.ArchVariant, arch.CpuVariant)
 }
@@ -471,13 +472,13 @@
 			flags.GlobalFlags = append(flags.GlobalFlags,
 				toolchain.ClangCflags(),
 				"${commonClangGlobalCflags}",
-				fmt.Sprintf("${%sClangGlobalCflags}", ctx.Arch().HostOrDevice))
+				fmt.Sprintf("${%sClangGlobalCflags}", ctx.HostOrDevice()))
 		} else {
 			flags.CppFlags = append(flags.CppFlags, "${commonGlobalCppflags}")
 			flags.GlobalFlags = append(flags.GlobalFlags,
 				toolchain.Cflags(),
 				"${commonGlobalCflags}",
-				fmt.Sprintf("${%sGlobalCflags}", ctx.Arch().HostOrDevice))
+				fmt.Sprintf("${%sGlobalCflags}", ctx.HostOrDevice()))
 		}
 
 		if ctx.Device() {
@@ -588,7 +589,7 @@
 					// of host and device.  Ignore the disabled one.
 					return
 				}
-				if a.HostOrDevice() != ctx.Arch().HostOrDevice {
+				if a.HostOrDevice() != ctx.HostOrDevice() {
 					ctx.ModuleErrorf("host/device mismatch between %q and %q", ctx.ModuleName(),
 						otherName)
 					return