Add cc_prebuilt_object.

To be used for prebuilt object support in SDK snapshots.

Test: m nothing
Bug: 148934017
Change-Id: I53d58100cc1d410c5cf5b7906de7ed6f7add2035
diff --git a/cc/object.go b/cc/object.go
index ad31d09..74badc9 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -47,12 +47,18 @@
 	Linker_script *string `android:"path,arch_variant"`
 }
 
+func newObject() *Module {
+	module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth)
+	module.sanitize = &sanitize{}
+	module.stl = &stl{}
+	return module
+}
+
 // cc_object runs the compiler without running the linker. It is rarely
 // necessary, but sometimes used to generate .s files from .c files to use as
 // input to a cc_genrule module.
 func ObjectFactory() android.Module {
-	module := newBaseModule(android.HostAndDeviceSupported, android.MultilibBoth)
-	module.sanitize = &sanitize{}
+	module := newObject()
 	module.linker = &objectLinker{
 		baseLinker: NewBaseLinker(module.sanitize),
 	}
@@ -61,7 +67,6 @@
 	// Clang's address-significance tables are incompatible with ld -r.
 	module.compiler.appendCflags([]string{"-fno-addrsig"})
 
-	module.stl = &stl{}
 	return module.Init()
 }