summaryrefslogtreecommitdiff
path: root/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-28 01:49:21 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-28 01:49:21 +0000
commit4213618088b0c0c85b208a01b45d89972984831b (patch)
treed302131b9b8b8702307adeae64946a470282c170 /lib/Support/Path.cpp
parentbf0184b6841a729bd09efff59fc4906e091024ec (diff)
downloadllvm-4213618088b0c0c85b208a01b45d89972984831b.tar.gz
llvm-4213618088b0c0c85b208a01b45d89972984831b.tar.bz2
llvm-4213618088b0c0c85b208a01b45d89972984831b.tar.xz
Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122589 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Path.cpp')
-rw-r--r--lib/Support/Path.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp
index c3353fd0e2..3e0ee8dd86 100644
--- a/lib/Support/Path.cpp
+++ b/lib/Support/Path.cpp
@@ -140,7 +140,11 @@ sys::IdentifyFileType(const char *magic, unsigned length) {
bool
Path::isArchive() const {
- return hasMagicNumber("!<arch>\012");
+ std::string Magic;
+ if (getMagicNumber(Magic, 8))
+ if (IdentifyFileType(Magic.c_str(), Magic.length()) == Archive_FileType)
+ return true;
+ return false;
}
bool