Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
llvm-svn: 122589
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index c3353fd..3e0ee8d 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -140,7 +140,11 @@
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