Add some win64 coff goodness.
Patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111287 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 201df5e..d193b98 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -164,7 +164,7 @@
   /// Inst - The instruction this is a fragment for.
   MCInst Inst;
 
-  /// InstSize - The size of the currently encoded instruction.
+  /// Code - Binary data for the currently encoded instruction.
   SmallString<8> Code;
 
   /// Fixups - The list of fixups in this fragment.
diff --git a/include/llvm/Support/COFF.h b/include/llvm/Support/COFF.h
index 5af4b29..a25cc78 100644
--- a/include/llvm/Support/COFF.h
+++ b/include/llvm/Support/COFF.h
@@ -48,6 +48,11 @@
     uint16_t Characteristics;
   };
 
+  enum MachineTypes {
+    IMAGE_FILE_MACHINE_I386 = 0x14C,
+    IMAGINE_FILE_MACHINE_AMD64 = 0x8664
+  };
+
   struct symbol {
     char     Name[NameSize];
     uint32_t Value;
@@ -199,7 +204,25 @@
     IMAGE_REL_I386_SECREL   = 0x000B,
     IMAGE_REL_I386_TOKEN    = 0x000C,
     IMAGE_REL_I386_SECREL7  = 0x000D,
-    IMAGE_REL_I386_REL32    = 0x0014
+    IMAGE_REL_I386_REL32    = 0x0014,
+
+    IMAGE_REL_AMD64_ABSOLUTE  = 0x0000,
+    IMAGE_REL_AMD64_ADDR64    = 0x0001,
+    IMAGE_REL_AMD64_ADDR32    = 0x0002,
+    IMAGE_REL_AMD64_ADDR32NB  = 0x0003,
+    IMAGE_REL_AMD64_REL32     = 0x0004,
+    IMAGE_REL_AMD64_REL32_1   = 0x0005,
+    IMAGE_REL_AMD64_REL32_2   = 0x0006,
+    IMAGE_REL_AMD64_REL32_3   = 0x0007,
+    IMAGE_REL_AMD64_REL32_4   = 0x0008,
+    IMAGE_REL_AMD64_REL32_5   = 0x0009,
+    IMAGE_REL_AMD64_SECTION   = 0x000A,
+    IMAGE_REL_AMD64_SECREL    = 0x000B,
+    IMAGE_REL_AMD64_SECREL7   = 0x000C,
+    IMAGE_REL_AMD64_TOKEN     = 0x000D,
+    IMAGE_REL_AMD64_SREL32    = 0x000E,
+    IMAGE_REL_AMD64_PAIR      = 0x000F,
+    IMAGE_REL_AMD64_SSPAN32   = 0x0010
   };
 
   enum COMDATType {
diff --git a/test/Scripts/coff-dump.py b/test/Scripts/coff-dump.py
index 57a5813..464ab31 100755
--- a/test/Scripts/coff-dump.py
+++ b/test/Scripts/coff-dump.py
@@ -32,7 +32,7 @@
 	('MachineType', ('enum', '<H', '0x%X', {
 		0x0:    'IMAGE_FILE_MACHINE_UNKNOWN',
 		0x1d3:  'IMAGE_FILE_MACHINE_AM33',
-		0x866:  'IMAGE_FILE_MACHINE_AMD64',
+		0x8664: 'IMAGE_FILE_MACHINE_AMD64',
 		0x1c0:  'IMAGE_FILE_MACHINE_ARM',
 		0xebc:  'IMAGE_FILE_MACHINE_EBC',
 		0x14c:  'IMAGE_FILE_MACHINE_I386',
@@ -140,6 +140,25 @@
 					0x000D: 'IMAGE_REL_I386_SECREL7',
 					0x0014: 'IMAGE_REL_I386_REL32',
 				},
+				0x8664: {
+					0x0000: 'IMAGE_REL_AMD64_ABSOLUTE',
+					0x0001: 'IMAGE_REL_AMD64_ADDR64',
+					0x0002: 'IMAGE_REL_AMD64_ADDR32',
+					0x0003: 'IMAGE_REL_AMD64_ADDR32NB',
+					0x0004: 'IMAGE_REL_AMD64_REL32',
+					0x0005: 'IMAGE_REL_AMD64_REL32_1',
+					0x0006: 'IMAGE_REL_AMD64_REL32_2',
+					0x0007: 'IMAGE_REL_AMD64_REL32_3',
+					0x0008: 'IMAGE_REL_AMD64_REL32_4',
+					0x0009: 'IMAGE_REL_AMD64_REL32_5',
+					0x000A: 'IMAGE_REL_AMD64_SECTION',
+					0x000B: 'IMAGE_REL_AMD64_SECREL',
+					0x000C: 'IMAGE_REL_AMD64_SECREL7',
+					0x000D: 'IMAGE_REL_AMD64_TOKEN',
+					0x000E: 'IMAGE_REL_AMD64_SREL32',
+					0x000F: 'IMAGE_REL_AMD64_PAIR',
+					0x0010: 'IMAGE_REL_AMD64_SSPAN32',
+				},
 			}))),
 			('SymbolName',       ('ptr', '+ PointerToSymbolTable * - SymbolTableIndex 1 18', ('scalar',  '<8s', symname)))
 		])))),