diff options
author | Rui Ueyama <ruiu@google.com> | 2013-11-15 21:22:02 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-11-15 21:22:02 +0000 |
commit | e448f9e418ffcec6fdadfc51af213f0d11645296 (patch) | |
tree | 44a130087d4fb54035ebfcbfc2f1059860b2132e /llvm/lib/Support/Path.cpp | |
parent | 94f2271d6342ddda5812ae639e873a7913acdc83 (diff) | |
download | bcm5719-llvm-e448f9e418ffcec6fdadfc51af213f0d11645296.tar.gz bcm5719-llvm-e448f9e418ffcec6fdadfc51af213f0d11645296.zip |
Path: Recognize COFF import library file magic.
Summary: Make identify_magic to recognize COFF import file.
Reviewers: Bigcheese
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2165
llvm-svn: 194852
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r-- | llvm/lib/Support/Path.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp index dfa18aaa6d2..c869b30a8e2 100644 --- a/llvm/lib/Support/Path.cpp +++ b/llvm/lib/Support/Path.cpp @@ -848,6 +848,10 @@ error_code has_magic(const Twine &path, const Twine &magic, bool &result) { return file_magic::unknown; switch ((unsigned char)Magic[0]) { case 0x00: { + // COFF short import library file + if (Magic[1] == (char)0x00 && Magic[2] == (char)0xff && + Magic[3] == (char)0xff) + return file_magic::coff_import_library; // Windows resource file const char Expected[] = { 0, 0, 0, 0, '\x20', 0, 0, 0, '\xff' }; if (Magic.size() >= sizeof(Expected) && |