summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitc581fe7e81958609bdacc271a6845d7e65162c05 (patch)
tree8dacd4d9c5ddaf45a7e5ede2fe14ed94854dd6d2 /llvm/lib/Support/Path.cpp
parent9d1419841a274e5fd1b0151554b40b3b3e791081 (diff)
downloadbcm5719-llvm-c581fe7e81958609bdacc271a6845d7e65162c05.tar.gz
bcm5719-llvm-c581fe7e81958609bdacc271a6845d7e65162c05.zip
Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
llvm-svn: 122589
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index c3353fd0e2b..3e0ee8dd86d 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud