Index: llvm/trunk/include/llvm/BinaryFormat/Magic.h
===================================================================
--- llvm/trunk/include/llvm/BinaryFormat/Magic.h
+++ llvm/trunk/include/llvm/BinaryFormat/Magic.h
@@ -49,6 +49,7 @@
     xcoff_object_64,     ///< 64-bit XCOFF object file
     wasm_object,         ///< WebAssembly Object file
     pdb,                 ///< Windows PDB debug info file
+    tapi_file,           ///< Text-based Dynamic Library Stub file
   };
 
   bool is_object() const { return V != unknown; }
Index: llvm/trunk/lib/BinaryFormat/Magic.cpp
===================================================================
--- llvm/trunk/lib/BinaryFormat/Magic.cpp
+++ llvm/trunk/lib/BinaryFormat/Magic.cpp
@@ -210,6 +210,11 @@
       return file_magic::coff_object;
     break;
 
+  case 0x2d: // YAML '-'
+    if (startswith(Magic, "--- !tapi") || startswith(Magic, "---\narchs:"))
+      return file_magic::tapi_file;
+    break;
+
   default:
     break;
   }
Index: llvm/trunk/lib/Object/Binary.cpp
===================================================================
--- llvm/trunk/lib/Object/Binary.cpp
+++ llvm/trunk/lib/Object/Binary.cpp
@@ -86,6 +86,9 @@
     return errorCodeToError(object_error::invalid_file_type);
   case file_magic::minidump:
     return MinidumpFile::create(Buffer);
+  case file_magic::tapi_file:
+    // Placeholder until TAPI is supported for lib/Object
+    return errorCodeToError(object_error::invalid_file_type);
   }
   llvm_unreachable("Unexpected Binary File Type");
 }
Index: llvm/trunk/lib/Object/ObjectFile.cpp
===================================================================
--- llvm/trunk/lib/Object/ObjectFile.cpp
+++ llvm/trunk/lib/Object/ObjectFile.cpp
@@ -127,6 +127,8 @@
   case file_magic::pdb:
   case file_magic::minidump:
     return errorCodeToError(object_error::invalid_file_type);
+  case file_magic::tapi_file:
+    return errorCodeToError(object_error::invalid_file_type);
   case file_magic::elf:
   case file_magic::elf_relocatable:
   case file_magic::elf_executable:
Index: llvm/trunk/lib/Object/SymbolicFile.cpp
===================================================================
--- llvm/trunk/lib/Object/SymbolicFile.cpp
+++ llvm/trunk/lib/Object/SymbolicFile.cpp
@@ -53,6 +53,7 @@
   case file_magic::windows_resource:
   case file_magic::pdb:
   case file_magic::minidump:
+  case file_magic::tapi_file:
     return errorCodeToError(object_error::invalid_file_type);
   case file_magic::elf:
   case file_magic::elf_executable:
Index: llvm/trunk/unittests/BinaryFormat/TestFileMagic.cpp
===================================================================
--- llvm/trunk/unittests/BinaryFormat/TestFileMagic.cpp
+++ llvm/trunk/unittests/BinaryFormat/TestFileMagic.cpp
@@ -82,6 +82,8 @@
 const char ms_dos_stub_broken[] = "\x4d\x5a\x20\x20";
 const char pdb[] = "Microsoft C/C++ MSF 7.00\r\n\x1a"
                    "DS\x00\x00\x00";
+const char tapi_file[] = "--- !tapi-tbd-v1\n";
+const char tapi_file_tbd_v1[] = "---\narchs: [";
 
 TEST_F(MagicTest, Magic) {
   struct type {
@@ -114,6 +116,9 @@
       DEFINE(pdb),
       {"ms_dos_stub_broken", ms_dos_stub_broken, sizeof(ms_dos_stub_broken),
        file_magic::unknown},
+      DEFINE(tapi_file),
+      {"tapi_file_tbd_v1", tapi_file_tbd_v1, sizeof(tapi_file_tbd_v1),
+       file_magic::tapi_file},
 #undef DEFINE
   };