summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-06-11 21:53:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-06-11 21:53:22 +0000
commitc6d63a3b0da4ad49e4c29e2d4ae148d76dfe38ec (patch)
tree9b6c5e4fae4560c8fb780ed778a5f2db634be50b /lib/Support
parenta2d36a20fa0803a596a1b3194abd52fa92f830cc (diff)
downloadllvm-c6d63a3b0da4ad49e4c29e2d4ae148d76dfe38ec.tar.gz
llvm-c6d63a3b0da4ad49e4c29e2d4ae148d76dfe38ec.tar.bz2
llvm-c6d63a3b0da4ad49e4c29e2d4ae148d76dfe38ec.tar.xz
Remove unused has_magic.
This will allow inlining get_magic, which should in turn fix one of the mingw build problems after the switch to std::error_code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/Path.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/Support/Path.cpp b/lib/Support/Path.cpp
index a9ac88e5d3..c063bed2b5 100644
--- a/lib/Support/Path.cpp
+++ b/lib/Support/Path.cpp
@@ -890,24 +890,6 @@ void directory_entry::replace_filename(const Twine &filename, file_status st) {
Status = st;
}
-error_code has_magic(const Twine &path, const Twine &magic, bool &result) {
- SmallString<32> MagicStorage;
- StringRef Magic = magic.toStringRef(MagicStorage);
- SmallString<32> Buffer;
-
- if (error_code ec = get_magic(path, Magic.size(), Buffer)) {
- if (ec == std::errc::value_too_large) {
- // Magic.size() > file_size(Path).
- result = false;
- return error_code();
- }
- return ec;
- }
-
- result = Magic == Buffer;
- return error_code();
-}
-
/// @brief Identify the magic in magic.
file_magic identify_magic(StringRef Magic) {
if (Magic.size() < 4)