From 557a81e9d7a17974ec11ff6bfb9f1ca4a5450ebd Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 14 Sep 2011 00:39:22 +0000 Subject: [PATCH] ObjectFile: Add support for mach-o-style dSYM companion files. llvm-svn: 139676 --- llvm/include/llvm/Support/PathV1.h | 1 + llvm/lib/Object/ObjectFile.cpp | 1 + llvm/lib/Support/Path.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Support/PathV1.h b/llvm/include/llvm/Support/PathV1.h index 024bb39cedc2..45165ded619c 100644 --- a/llvm/include/llvm/Support/PathV1.h +++ b/llvm/include/llvm/Support/PathV1.h @@ -733,6 +733,7 @@ namespace sys { Mach_O_DynamicLinker_FileType, ///< The Mach-O dynamic linker Mach_O_Bundle_FileType, ///< Mach-O Bundle file Mach_O_DynamicallyLinkedSharedLibStub_FileType, ///< Mach-O Shared lib stub + Mach_O_DSYMCompanion_FileType, ///< Mach-O dSYM companion file COFF_FileType ///< COFF object file or lib }; diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index a7798df33fe5..69d8ed0e5e9a 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -45,6 +45,7 @@ ObjectFile *ObjectFile::createObjectFile(MemoryBuffer *Object) { case sys::Mach_O_DynamicLinker_FileType: case sys::Mach_O_Bundle_FileType: case sys::Mach_O_DynamicallyLinkedSharedLibStub_FileType: + case sys::Mach_O_DSYMCompanion_FileType: return createMachOObjectFile(Object); case sys::COFF_FileType: return createCOFFObjectFile(Object); diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index 8fbaf2d42bf9..e5b7cd3bfbc2 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -121,7 +121,7 @@ sys::IdentifyFileType(const char *magic, unsigned length) { case 7: return Mach_O_DynamicLinker_FileType; case 8: return Mach_O_Bundle_FileType; case 9: return Mach_O_DynamicallyLinkedSharedLibStub_FileType; - case 10: break; // FIXME: MH_DSYM companion file with only debug. + case 10: return Mach_O_DSYMCompanion_FileType; } break; }