CodeGen: add support for emitting ObjC image info

This ensures that we can emit the ObjC Image Info structure on COFF and
ELF as well.  The frontend already would attempt to emit this
information but would get dropped when generating assembly or an object
file.

llvm-svn: 304736
diff --git a/llvm/test/Object/objc-imageinfo-coff.ll b/llvm/test/Object/objc-imageinfo-coff.ll
new file mode 100644
index 0000000..cab0103
--- /dev/null
+++ b/llvm/test/Object/objc-imageinfo-coff.ll
@@ -0,0 +1,14 @@
+; RUN: llc -mtriple x86_64-unknown-windows-msvc -filetype asm -o - %s | FileCheck %s
+
+!llvm.module.flags = !{!0, !1, !2, !3}
+
+!0 = !{i32 1, !"Objective-C Version", i32 2}
+!1 = !{i32 1, !"Objective-C Image Info Version", i32 0}
+!2 = !{i32 1, !"Objective-C Image Info Section", !".objc_imageinfo$B"}
+!3 = !{i32 1, !"Objective-C Garbage Collection", i32 2}
+
+; CHECK: .section .objc_imageinfo$B,"dr"
+; CHECK: OBJC_IMAGE_INFO:
+; CHECK:   .long 0
+; CHECK:   .long 2
+